Skip to content

Commit

Permalink
Merge pull request #4650 from haskell/2.0-travis-2.0
Browse files Browse the repository at this point in the history
Use cabal-install 2.0 on Travis for the 2.0 branch as well
  • Loading branch information
23Skidoo authored Aug 2, 2017
2 parents d8d5a53 + 4346ba6 commit 387d443
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ before_install:
- export PATH=$HOME/bin:$PATH
- export PATH=$HOME/.cabal/bin:$PATH
- export PATH=$HOME/.local/bin:$PATH
- export PATH=/opt/cabal/1.24/bin:$PATH
- export PATH=/opt/cabal/2.0/bin:$PATH
- export PATH=/opt/happy/1.19.5/bin:$PATH
- export PATH=/opt/alex/3.1.7/bin:$PATH
- ./travis-install.sh
Expand Down
14 changes: 10 additions & 4 deletions travis-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ HACKAGE_REPO_TOOL_VERSION="0.1.1"
CABAL_VERSION="2.0.0.2"
CABAL_INSTALL_VERSION="2.0.0.0"

if [ "$TRAVIS_OS_NAME" = "linux" ]; then
ARCH="x86_64-linux"
else
ARCH="x86_64-osx"
fi

CABAL_STORE_DB="${HOME}/.cabal/store/ghc-${GHCVER}/package.db"
CABAL_LOCAL_DB="${TRAVIS_BUILD_DIR}/dist-newstyle/packagedb/ghc-${GHCVER}"
CABAL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/Cabal-${CABAL_VERSION}"
CABAL_TESTSUITE_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/cabal-testsuite-${CABAL_VERSION}"
CABAL_INSTALL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/cabal-install-${CABAL_INSTALL_VERSION}"
CABAL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/Cabal-${CABAL_VERSION}"
CABAL_TESTSUITE_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/cabal-testsuite-${CABAL_VERSION}"
CABAL_INSTALL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/cabal-install-${CABAL_INSTALL_VERSION}"
CABAL_INSTALL_SETUP="${CABAL_INSTALL_BDIR}/setup/setup"
HACKAGE_REPO_TOOL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}"
HACKAGE_REPO_TOOL_BDIR="${TRAVIS_BUILD_DIR}/dist-newstyle/build/$ARCH/ghc-$GHCVER/hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}/c/hackage-repo-tool"

# ---------------------------------------------------------------------
# Timing / diagnostic output
Expand Down
7 changes: 3 additions & 4 deletions travis-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ -z ${STACKAGE_RESOLVER+x} ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
travis_retry sudo add-apt-repository -y ppa:hvr/ghc
travis_retry sudo apt-get update
travis_retry sudo apt-get install --force-yes cabal-install-1.24 happy-1.19.5 alex-3.1.7 ghc-$GHCVER-prof ghc-$GHCVER-dyn
travis_retry sudo apt-get install --force-yes cabal-install-2.0 happy-1.19.5 alex-3.1.7 ghc-$GHCVER-prof ghc-$GHCVER-dyn
if [ "x$TEST_OTHER_VERSIONS" = "xYES" ]; then travis_retry sudo apt-get install --force-yes ghc-7.0.4-prof ghc-7.0.4-dyn ghc-7.2.2-prof ghc-7.2.2-dyn ghc-head-prof ghc-head-dyn; fi

elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
Expand Down Expand Up @@ -59,10 +59,9 @@ if [ -z ${STACKAGE_RESOLVER+x} ]; then
make install;
cd ..;

travis_retry curl -L https://www.haskell.org/cabal/release/cabal-install-1.24.0.2/cabal-install-1.24.0.2-x86_64-apple-darwin-yosemite.tar.gz -o cabal-install.tar.gz
TAR=$PWD/cabal-install.tar.gz
mkdir "${HOME}/bin"
(cd "${HOME}/bin" && tar -xzf "$TAR")
travis_retry curl -L http://web.mit.edu/~ezyang/Public/cabal-install-2.0.0.0-osx.gz | gunzip -c > "${HOME}/bin/cabal"
chmod a+x "${HOME}/bin/cabal"
"${HOME}/bin/cabal" --version

else
Expand Down
2 changes: 1 addition & 1 deletion travis-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ timed ${CABAL_INSTALL_BDIR}/build/cabal/cabal update
# Big tests
(cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests --builddir=${CABAL_TESTSUITE_BDIR} -j3 --skip-setup-tests --with-cabal ${CABAL_INSTALL_BDIR}/build/cabal/cabal --with-hackage-repo-tool ${HACKAGE_REPO_TOOL_BDIR}/build/hackage-repo-tool/hackage-repo-tool $TEST_OPTIONS) || exit $?

(cd cabal-install && timed cabal check) || exit $?
# (cd cabal-install && timed cabal check) || exit $?

unset CABAL_BUILDDIR

Expand Down
6 changes: 3 additions & 3 deletions travis/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ cp $TRAVIS_BUILD_DIR/travis/id_rsa .
cp $TRAVIS_BUILD_DIR/travis-install.sh .
cp $TRAVIS_BUILD_DIR/travis-common.sh .
# The binaries to test (statically linked, of course!)
cp ${CABAL_BDIR}/build/unit-tests/unit-tests Cabal
cp ${CABAL_BDIR}/c/unit-tests/build/unit-tests/unit-tests Cabal
if [ "x$PARSEC" = "xYES" ]; then
cp ${CABAL_BDIR}/build/parser-tests/parser-tests Cabal
cp ${CABAL_BDIR}/build/parser-hackage-tests/parser-hackage-tests Cabal
cp ${CABAL_BDIR}/c/parser-tests/build/parser-tests/parser-tests Cabal
cp ${CABAL_BDIR}/c/parser-hackage-tests/build/parser-hackage-tests/parser-hackage-tests Cabal
fi
if [ "x$CABAL_LIB_ONLY" != "xYES" ]; then
cp ${CABAL_INSTALL_BDIR}/build/cabal/cabal cabal-install
Expand Down

0 comments on commit 387d443

Please sign in to comment.