You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cabal init fails with 'no package name provided' if name is already taken on hackage #7273
Describe the bug
When I do cabal init this doesn't prompt me for anything and just dies.
Guessing dependencies...
Generating LICENSE...
Warning: unknown license type, you must put a copy in LICENSE yourself.
Generating Setup.hs...
Generating CHANGELOG.md...
Generating Main.hs...
Error: no package name provided.
explicitly specifying interactive mode gets:
Should I generate a simple project with sensible defaults? [default: y] y
Guessing dependencies...
Generating LICENSE...
Warning: unknown license type, you must put a copy in LICENSE yourself.
Generating Setup.hs...
Warning: Setup.hs already exists, backing up old version in Setup.hs.save0
Generating CHANGELOG.md...
Warning: CHANGELOG.md already exists, backing up old version in CHANGELOG.md.save0
Error: no package name provided.
and the cabal file is never created. Only
CHANGELOG.md Main.hs Setup.hs
To Reproduce
Steps to reproduce the behavior:
$ cabal init
Please use version-prefixed commands (e.g. v2-build or v1-build) to avoid ambiguity.
Expected behavior
A clear and concise description of what you expected to happen.
System information
Operating system: Windows 10 (bash or powershell)
cabal, ghc versions: 3.2.0.0 and 8.8.4
Additional context
Add any other context about the problem here.
@fgaz wow.. it's... very interesting... I've tried in a number of directories and they work, but if I create a directory named monarch anywhere... cabal init fails with the error above..
Please update the title of this issue to something less generic, e.g. "Cabal init fails with 'no package name provided' if name is already taken on hackage".
changed the title [-]Cabal init doesn't seem to work[/-][+]Cabal init fails with 'no package name provided' if name is already taken on hackage[/+]on May 14, 2021
Hi! It works fine on master branch (to be released as 3.8; I haven't tried with 3.6.2). It asks you whether you want to name the package so anyway and then proceeds fine. Please confirm.
Thank you again. I guess you may need (regardless of upgrading) to run cabal init in interactive mode to enable the choice. No needed on the master branch, which is interactive by default now.
Activity
fgaz commentedon Feb 7, 2021
Does this happen in any directory or just in ones with specific names?
Mistuke commentedon Feb 7, 2021
@fgaz wow.. it's... very interesting... I've tried in a number of directories and they work, but if I create a directory named
monarchanywhere...cabal initfails with the error above..jhrcek commentedon Feb 7, 2021
It's probably because there already is package with the name like that on hackage: http://hackage.haskell.org/package/monarch
I saw issue like that in the past: #6236
Mistuke commentedon Feb 7, 2021
Oh wow, that does sound like the issue indeed
Mistuke commentedon Feb 7, 2021
The fix seems relatively recent. I'll try cabal 3.4 rc5
emilypi commentedon Feb 8, 2021
Yeah, this is the dumb "if the package name already exists, it'll crap out with no reasonable error" workflow. I'm adding this to my work on #7265
andreasabel commentedon Feb 18, 2021
Please update the title of this issue to something less generic, e.g. "Cabal init fails with 'no package name provided' if name is already taken on hackage".
[-]Cabal init doesn't seem to work[/-][+]Cabal init fails with 'no package name provided' if name is already taken on hackage[/+]KristianBalaj commentedon Jan 18, 2022
This issue is still appearing with cabal
3.4.1.0I named the directory
streamingand thecabal initfailed with the error.Mikolaj commentedon Jan 19, 2022
Hi @KristianBalaj,
Hi! It works fine on master branch (to be released as 3.8; I haven't tried with 3.6.2). It asks you whether you want to name the package so anyway and then proceeds fine. Please confirm.
KristianBalaj commentedon Jan 20, 2022
@Mikolaj
The following is the behaviour with cabal
3.4.1.0, it does not ask for anything:Mikolaj commentedon Jan 20, 2022
@KristianBalaj: thank you for checking. I guess you need to upgrade?
KristianBalaj commentedon Jan 20, 2022
Yeah sure, I was just reporting that in that version of cabal it is still an issue.
Mikolaj commentedon Jan 20, 2022
Thank you again. I guess you may need (regardless of upgrading) to run
cabal initin interactive mode to enable the choice. No needed on the master branch, which is interactive by default now.