cabal icon indicating copy to clipboard operation
cabal copied to clipboard

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

Open fgaz opened this issue 3 years ago • 2 comments

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 avatar Jun 10 '22 12:06 fgaz

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

Mikolaj avatar Jun 10 '22 12:06 Mikolaj

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

emilypi avatar Jun 10 '22 17:06 emilypi

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

Mikolaj avatar Feb 09 '23 17:02 Mikolaj

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

ptkato avatar Feb 11 '23 13:02 ptkato

Thank you!

Mikolaj avatar Feb 13 '23 11:02 Mikolaj