I have a project that requires GHC 7.10.2, so to use Travis CI I must install the required version of GHC myself in a pre-install step.
I currently have this working with
env:
- CABALVER=1.22 GHCVER=7.10.2
before_install:
- |
travis_retry sudo add-apt-repository -y ppa:hvr/ghc
travis_retry sudo apt-get update
travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
in my .travis.yml
; but am limited to using the "legacy" infrastructure because of my use of sudo
.
I'd like to take advantage of the new container-based infrastructure, and have followed the migration docs as far as I can, resulting in
sudo: false
env:
- CABALVER=1.22 GHCVER=7.10.2
addons:
apt:
sources:
- hvr-ghc
packages:
- cabal-install-$CABALVER
- ghc-$GHCVER
before_install:
- |
export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
as what seems to me should be the equivalent of the above. But this proceeds to use the default (7.4) version of GHC, which results in a failed build.
How do I build for Haskell 7.10.2 in the container-based infrastructure? Specifically, what should I have in my .travis.yml
?