From af7486cc6dc97ac9208707255cb2317466114565 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Tue, 26 Mar 2019 11:39:41 -0700
Subject: [PATCH] circleci: explicitly specify ghc version to use.

---
 .circleci/config.yml | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 11125b00a..3f32f5f8c 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -40,28 +40,30 @@ commands:
       - checkout
       - *preinstall
       - *restore
+      - run:
+          name: install cabal
+          command: apt-get install -y cabal-install-2.4
       - run:
           name: install ghc
           command: apt-get install -y ghc-<< parameters.ghcversion >>
       - run: |
           set -e
-          apt-get install -y cabal-install-2.4
           cabal v2-update
           TMPDIR=`mktemp -d -t circleci.XXXXXXX`
           cabal v2-sdist --output-dir=${TMPDIR}
           cd ${TMPDIR}
           tar xvzf *.tar.gz
           cd *
-          cabal v2-build -j2 --dependencies-only --enable-tests --ghc-options="${GHC_OPTS}" all
-          cabal v2-build -j2 --enable-tests --ghc-options="${GHC_OPTS}" all 2>build.log
+          cabal v2-build -w ghc-<< parameters.ghcversion >> -j2 --dependencies-only --enable-tests --ghc-options="${GHC_OPTS}" all
+          cabal v2-build -w ghc-<< parameters.ghcversion>> -j2 --enable-tests --ghc-options="${GHC_OPTS}" all 2>build.log
           cat build.log
           # fail if we had warnings in local build
           # this is to work around the fact that cabal v2 doesn't allow
           # us to use -Werror for just local build:
           # https://github.com/haskell/cabal/issues/4247
           ! grep -q "warning:" build.log
-          cabal v2-test --ghc-options="${GHC_OPTS}" 2>build.log
-          cabal v2-haddock --ghc-options="${GHC_OPTS}"
+          cabal v2-test -w ghc-<< parameters.ghcversion >> --ghc-options="${GHC_OPTS}" 2>build.log
+          cabal v2-haddock -w ghc-<< parameters.ghcversion >> --ghc-options="${GHC_OPTS}"
           cabal check
       - *save