Skip to content
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: --package-dir seems to be ignored #9157

Open
ffaf1 opened this issue Jul 30, 2023 · 5 comments
Open

cabal init: --package-dir seems to be ignored #9157

ffaf1 opened this issue Jul 30, 2023 · 5 comments

Comments

@ffaf1
Copy link
Collaborator

ffaf1 commented Jul 30, 2023

Describe the bug
cabal init --package-dir some-dir does not work (does not work = the files do not get written inside some-dir).

To Reproduce

f@mkiii:~/download$ cabal init --package-dir=/tmp/app/ -nm
Warning: this is a debug build of cabal-install with assertions enabled.
[Log] Guessing dependencies...
[Log] Using cabal specification: 3.0
[Warning] unknown license type, you must put a copy in LICENSE yourself.
[Log] Creating fresh file CHANGELOG.md...
[Log] Creating fresh directory ./app...
[Log] Creating fresh file app/Main.hs...
[Log] Creating fresh file app.cabal...
[Warning] No synopsis given. You should edit the .cabal file and add one.
[Info] You may want to edit the .cabal file and add a Description field.

f@mkiii:~/download$ lsc
app  app.cabal  CHANGELOG.md
f@mkiii:~/download$ ls /tmp/app/
f@mkiii:~/download$

Expected behavior
After running cabal init --package-dir=/tmp/app/ -nm, I want folders, cal files etc. to be written in /tmp/app.

System information

  • Debian bookworm
  • cabal 3.11, ghc 9.2.8

Additional context

--help entry for --package-dir

 --package-dir=DIRECTORY        Root directory of the package (default =
                                current directory).
@ffaf1
Copy link
Collaborator Author

ffaf1 commented Jul 30, 2023

Same problem with 3.10.1.0

@fgaz
Copy link
Member

fgaz commented Jul 31, 2023

cc @emilypi @ptkato

@ptkato
Copy link
Collaborator

ptkato commented Aug 1, 2023

I don't remember how that was wired before the rewrite, but a fix for this would probably need to go in here, due to the changes in #7873.

@alt-romes
Copy link
Collaborator

I've just run into this as well with 3.10.

@alt-romes
Copy link
Collaborator

I don't remember how that was wired before the rewrite, but a fix for this would probably need to go in here, due to the changes in #7873.

Following the source listed here, it seems that the first argument to cabal init is interpreted as the dir where to put the cabal project, so a workaround is

cabal init <project-dir>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants