-
Notifications
You must be signed in to change notification settings - Fork 704
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 interactive init is broken if project names overlap #6861
Comments
cc @m-renaud |
This appears to be broken regardless of the init flow, so I suspect this bug has been here a while:
Interestingly, if you explicitly specify the package name with
I can take a look this week. |
I tried with master and the problem lies in this function:
Using an already existing package name only 1 leads to desirable fail-fast behavior with understandable warning. 2 and 3 are silently translated to Nothing (
Error: no package name provided. further down the line.
I think it should fail fast with a warning also in cases 2 & 3 instead of continuing without setting a name. Would you agree? |
Thanks for looking into this @jhrcek, and I agree with your assessment. If you put together a PR feel free to add me as reviewer. |
@m-renaud @phadej I definitely want to contribute the fix, but I want to avoid just monkey patching.
Unfortunately the current approach (composing bunch of cabal/cabal-install/Distribution/Client/Init/Command.hs Lines 130 to 149 in 5274d6a
Would you be open to switching from plain IO to something like PS.: What behavior would you expect from |
So sorry for the very slow reply, I've been really busy lately.
Yeah this approach sounds good to me as its a bit more flexible that the
Hmm, I think that |
Describe the bug
If the directory overlaps with an existing Hackage pacakge, choosing "yes" when presented with
Should I generate a simple project with sensible defaults? [default: y]
fails to produce a valid build, or even a valid.cabal
file.To Reproduce
Expected behavior
If we're going to offer this feature, it should work regardless of Hackage. The counter-intuitive fix is to choose a name directory name that doesn't overlap with Hackage:
However, if I'm a beginner, or offline, I have no way of checking this information. In fact, for a bare install, I have no way of knowing that this is a requirement! If i have a brand new install, then it works (RIP my
~/.cabal
):System information
The text was updated successfully, but these errors were encountered: