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 --cabal-version 1.10 generates "cabal-version: 1.10" instead of "cabal-version: >=1.10" #8206

Closed
fgaz opened this issue Jun 10, 2022 · 5 comments · Fixed by #8860

Comments

@fgaz
Copy link
Member

fgaz commented Jun 10, 2022

Describe the bug
cabal init --cabal-version 1.10 generates "cabal-version: 1.10" instead of "cabal-version: >=1.10"

To Reproduce
Steps to reproduce the behavior:

$ cabal init -n --cabal-version=1.10 p

Warning: Cabal spec versions < 1.18 do not support extra-doc-files. Doc files will be treated as extra-src-files.

Log: Guessing dependencies...

Log: Using cabal specification: 1.10

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 p.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.
$ cd p
$ grep cabal-version: p.cabal
cabal-version:      1.10
$ cabal check
Warning: These warnings may cause trouble when distributing the package:
Warning: No 'category' field.
Warning: The 'license' is AllRightsReserved. Is that really what you want?
Warning: p.cabal:1:25: With 1.10 or earlier, the 'cabal-version' field must
use range syntax rather than a simple version number. Use 'cabal-version: >=
1.10'.
Warning: The following errors will cause portability problems on other
environments:
Warning: No 'synopsis' or 'description' field.
Warning: Hackage would reject this package.

Expected behavior
cabal-version: >=1.10

System information
cabal 3.8.1.0-rc1

cc @emilypi @ptkato

@fgaz fgaz added type: bug cabal-install: cmd/init type: regression regression on master Regression that is unreleased and needs to be fixed before release labels Jun 10, 2022
@Mikolaj
Copy link
Member

Mikolaj commented Jun 10, 2022

Perhaps let's just forbid too old versions as arguments to --cabal-version, with a sensible error message?

@emilypi
Copy link
Member

emilypi commented Jun 10, 2022

@ptkato mind fixing? Since we never really infer cabal version, this would be a validation pass on the flag input in the driver.

@Mikolaj
Copy link
Member

Mikolaj commented Feb 9, 2023

@ptkato: Hi! Did you have a look at this one?

@ptkato
Copy link
Collaborator

ptkato commented Feb 11, 2023

Honestly, I don't remember. Regardless, I'll look into it now.

@Mikolaj
Copy link
Member

Mikolaj commented Feb 13, 2023

Thank you!

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