[Haskell-cafe] PSA: How to use the cabal-version field in cabal files

Adam Bergmark adam at bergmark.nl
Sat May 2 08:31:16 UTC 2015


The cabal-version field seems pretty mysterious.

Recommendation: Set it no higher than >= 1.10, Cabal will warn you if it's
too low.

This field contains the format of the cabal file, the number corresponds to
the Cabal release. Hence this version is incremented more often than the
format actually changes. There have been no significant changes between
1.10 and 1.20. The Cabal source is surprisingly helpful as a changelog:
https://github.com/haskell/cabal/blob/641e854ae663e2b34f34ecc11ba663ac3a9bdc19/Cabal/Distribution/PackageDescription/Check.hs#L911-L1091

By setting it too high you risk users getting errors like "The package
'foo' requires Cabal library version -any && >=1.14 but no suitable version
is installed."

This can be problematic for anyone using an older GHC or if there are Cabal
releases outside of the GHC release cycle. You may get this error even if
you have a newer Cabal if it doesn't ship with GHC.

Happy hacking,
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150502/6ed1fdac/attachment.html>


More information about the Haskell-Cafe mailing list