Commit ae03fd02 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Enable hackage-repo-tool in CI



Note: hackage-repo-tool doesn't build with Windows, so that
support is commented out.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 09fc2a72
......@@ -20,6 +20,9 @@ build_script:
- Setup build
- Setup test --show-details=streaming --test-option=--hide-successes
- Setup install
# hackage-repo-tool doesn't build on Windows:
# https://github.com/well-typed/hackage-security/issues/175
# - echo "" | ..\cabal install hackage-repo-tool --allow-newer=Cabal,time --constraint="Cabal == 1.25.0.0"
- cd ..\cabal-testsuite
- ghc --make -threaded -i Setup.hs -package Cabal-1.25.0.0
- echo "" | ..\cabal install --only-dependencies --enable-tests
......
......@@ -3,6 +3,13 @@
-- Turn off parallelization to get good errors.
jobs: 1
-- We vendor a copy of hackage-repo-tool so that we can
-- build it reliably. If we eventually get new-install
-- in the bootstrap, this can go away.
optional-packages: hackage-repo-tool-*/
-- hackage-repo-tool has upper bound on Cabal
allow-newer: hackage-repo-tool:Cabal, hackage-repo-tool:time
-- The -fno-warn-orphans is a hack to make Cabal-1.24
-- build properly (unfortunately the flags here get applied
-- to the dependencies too!)
......
set -e
HACKAGE_REPO_TOOL_VERSION="0.1.1"
CABAL_VERSION="1.25.0.0"
# ---------------------------------------------------------------------
......
......@@ -15,6 +15,7 @@ CABAL_BDIR="${PWD}/dist-newstyle/build/Cabal-${CABAL_VERSION}"
CABAL_TESTSUITE_BDIR="${PWD}/dist-newstyle/build/cabal-testsuite-${CABAL_VERSION}"
CABAL_INSTALL_BDIR="${PWD}/dist-newstyle/build/cabal-install-${CABAL_VERSION}"
CABAL_INSTALL_SETUP="${CABAL_INSTALL_BDIR}/setup/setup"
HACKAGE_REPO_TOOL_BDIR="${PWD}/dist-newstyle/build/hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}"
# --hide-successes uses terminal control characters which mess up
# Travis's log viewer. So just print them all!
TEST_OPTIONS=""
......@@ -26,7 +27,7 @@ TEST_OPTIONS=""
timed cabal update
# ---------------------------------------------------------------------
# Install happy if necessary
# Install executables if necessary
# ---------------------------------------------------------------------
if ! command -v happy; then
......@@ -39,6 +40,12 @@ fi
cp cabal.project.travis cabal.project.local
# hackage-repo-tool is a bit touchy to install on GHC 8.0, so instead we
# do it via new-build. See also cabal.project.travis. The downside of
# doing it this way is that the build product cannot be cached, but
# hackage-repo-tool is a relatively small package so it's good.
cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}
# ---------------------------------------------------------------------
# Cabal
# ---------------------------------------------------------------------
......@@ -128,7 +135,9 @@ timed ${CABAL_INSTALL_BDIR}/build/cabal/cabal update
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/integration-tests2/integration-tests2 $TEST_OPTIONS) || exit $?
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/memory-usage-tests/memory-usage-tests $TEST_OPTIONS) || exit $?
(cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests -j3 --skip-setup-tests --with-cabal ${CABAL_INSTALL_BDIR}/build/cabal/cabal $TEST_OPTIONS) || exit $?
timed cabal new-build hackage-repo-tool
(cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests -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 $?
# Haddock
(cd cabal-install && timed ${CABAL_INSTALL_SETUP} haddock --builddir=${CABAL_INSTALL_BDIR} ) || exit $?
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment