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

亡梦爱人 提交于 2019-12-10 10:51:05

问题


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:


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:

  • I put together a page correlating GHC, base, and Cabal versions: https://www.snoyman.com/base
  • The Stackage homepage lists the latest LTS for each GHC version in the bottom left column: https://www.stackage.org/
  • You can check the Cabal library version for a specific LTS by following a link like https://www.stackage.org/lts-9/package/Cabal, which in this case auto-redirects to https://www.stackage.org/lts-9.21/package/Cabal-1.24.2.0.


来源:https://stackoverflow.com/questions/52338228/how-do-i-match-the-right-cabal-spec-with-each-resolver-in-my-travis-ci-builds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!