-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cabal init
crashes if git
is not installed
#10484
Comments
Huh. Supposedly this was fixed (#8478) unless I'm misreading. |
No, it looks like the 'fix' only deals with the case where
This should be easy to fix, it just requires catching the exceptions and returning |
@BasLaa will be able to diagnose quicker. |
I have a draft pull request that might fix this. |
Haven't check in the code, but the catch maybe that #8478 talks about the non-interactive mode whereas this ticket is about interactive. Unfortunately, since at least the last init rewrite (it happened a couple of years ago), the two modes have very little code in common (in comparison to what one might expect). |
I was misreading: that ticket fixed it when git was found but not configured. This one's about when git isn't found at all. |
Did you read the description of #8478? |
Describe the bug
Running
cabal init
withoutgit
installed results in the following error:or
To Reproduce
Run
cabal init
in an empty directory on a system withoutgit
installed or after setting$PATH
to something that includescabal
andghc
but notgit
. Answer the prompts; the program will exit with the above error message after you choose a license.Expected behavior
cabal init
should continue running and ask for author name, email address, etc.System information
cabal
3.10.3.0,ghc
9.6.5 on NixOs 24.05cabal
3.12.1.0,ghc
9.6.6 on OpenBSD 7.6-currentAdditional context
The function
Distribution.Client.Init.NonInteractive.Heuristics.guessGitInfo
usesreadProcessWithExitCode
, which throws anIOError
which should be caught if the file is not found.The text was updated successfully, but these errors were encountered: