Skip to content

Expand 'cabal init' docs to explain what -w means in that context #8103

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

Closed
Mikolaj opened this issue Apr 22, 2022 · 2 comments · Fixed by #8105
Closed

Expand 'cabal init' docs to explain what -w means in that context #8103

Mikolaj opened this issue Apr 22, 2022 · 2 comments · Fixed by #8105

Comments

@Mikolaj
Copy link
Member

Mikolaj commented Apr 22, 2022

Probably -w just uses a different GHC to run. But it could potentially set base bounds based on the GHC (please confirm it does not) or write the GHC to cabal.project (it does not), so a more verbose commandline help text would prevent confusion by clearly stating this is not the case.

@andreabedini
Copy link
Collaborator

@Mikolaj I can confirm cabal init uses -w to set base lower bounds (at least version 3.6.2.0)

$ mkdir my-project 
$ cd my-project/
~/my-project $ cabal init -w ghc-8.0
Guessing dependencies...

Generating LICENSE...
Warning: unknown license type, you must put a copy in LICENSE yourself.
Generating CHANGELOG.md...
Generating app/Main.hs...
Generating my-project.cabal...

Warning: no synopsis given. You should edit the .cabal file and add one.
You may want to edit the .cabal file and add a Description field.

$ grep base my-project.cabal 
    build-depends:    base ^>=4.9.1.0

~/my-project $ rm -rf *
~/my-project $ cabal init -w ghc-8.10

Guessing dependencies...

Generating LICENSE...
Warning: unknown license type, you must put a copy in LICENSE yourself.
Generating CHANGELOG.md...
Generating app/Main.hs...
Generating my-project.cabal...

Warning: no synopsis given. You should edit the .cabal file and add one.
You may want to edit the .cabal file and add a Description field.

$ grep base my-project.cabal 
    build-depends:    base ^>=4.14.3.0

@Mikolaj
Copy link
Member Author

Mikolaj commented Apr 22, 2022

Whoa, I had no idea. Then the docs are even more important, given that the semantics of -w differs so much between commands.

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

Successfully merging a pull request may close this issue.

2 participants