How do I match the right Cabal spec with each resolver in my Travis CI builds?

Viewed 86

After updating my Haskell package's .cabal file to Cabal 2.2, most of my Travis CI builds with resolvers older than LTS 12.9 fail with:

This package description follows version 2.2 of the Cabal specification. This tool only supports up to version XX.XX.XX.

where the version varies depending on the resolver specified in my .travis.yaml.

It seems that for each resolver I need to specify a different Cabal version In fact, because of Cabal spec changes, I appear to need a different .cabal file for each resolver. Is this the case? Is there a better way? How do I match the right Cabal spec with each resolver in my Travis CI builds?

1 Answers

To my knowledge, the Cabal spec version and Cabal library version always correspond, meaning that Cabal library version 2.0.C.D will support Cabal spec version 2.0 and earlier. You just need to check which version of the Cabal library ships with each LTS version, which depends on the GHC version. Some links that will help:

Related