Skip to content

cabal version from cabal --version not accepted in field cabal-version #7154

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
typetetris opened this issue Nov 7, 2020 · 3 comments
Closed

Comments

@typetetris
Copy link

typetetris commented Nov 7, 2020

I expected to be able to put the version number from cabal --version cropped accordingly into the field cabal-version.

$ cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library

and

cabal-version: 3.2

lead to

Errors encountered when parsing cabal file backend/backend.cabal:

backend/backend.cabal:0:0: error:
Unsupported cabal-version. See https://github.com/haskell/cabal/issues/4899.

It seems like only the version numbers in Package Description Format Specification History can be used in field cabal-version.

I would suggest to either note that in the documentation of cabal-version or accept any cabal version number and make cabal know, which version number lower or equal had the last format
change (or whatever else there is to know).

@phadej
Copy link
Collaborator

phadej commented Nov 7, 2020

The is no cabal-version: 3.2, see available versions: https://cabal.readthedocs.io/en/3.4/file-format-changelog.html

The confusion steps from cabal having at least three-four meanings https://gist.github.com/merijn/8152d561fb8b011f9313c48d876ceb07

  • Cabal the library
  • cabal the executable (cabal-install)
  • CABAL the spec
  • .cabal the package description file

The cabal-version in .cabal files indicates the version of the format of the file, which is CABAL the spec version, though latter haven't been update as a standalone document for ages.

@phadej phadej closed this as completed Nov 7, 2020
@typetetris
Copy link
Author

Yes it is really confusing that the term cabal is overloaded with four meanings.

I read

https://cabal.readthedocs.io/en/3.4/cabal-package.html?highlight=cabal-version#pkg-field-cabal-version

and

https://cabal.readthedocs.io/en/3.4/file-format-changelog.html

and didn't got that.

I guess I am not unique in that.

So maybe add a sentence to the first paragraph in https://cabal.readthedocs.io/en/3.4/cabal-package.html?highlight=cabal-version#pkg-field-cabal-version like

That means you can only choose on of the version listed in [Package Description Format Specification History](https://cabal.readthedocs.io/en/3.4/file-format-changelog.html#package-description-format-specification-history) for this field.

would probably a good idea to help reduce the confusion.

Sorry to bother you, just trying to help.

@typetetris
Copy link
Author

Also a link to this CABAL the spec would help. The overloaded meaning of the term cabal makes it really hard to google for that stuff.

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

2 participants