[commit: ghc] wip/nfs-locking: Rework Travis CI script (d0ffc1f)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:24:35 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/d0ffc1f8d7e109511b08c0a70a4956188718a911/ghc
>---------------------------------------------------------------
commit d0ffc1f8d7e109511b08c0a70a4956188718a911
Author: David Luposchainsky <dluposchainsky at gmail.com>
Date: Tue Jan 5 09:50:08 2016 +0100
Rework Travis CI script
- Move all .travis/*.sh functionality directly into .travis.yml
- Install Alex/Happy from PPA instead of compiling them by hand
- Skip Shake progress indicators, as they're rather useless
on clean-slate Travis builds, and clutter up the log
- Don't use a Cabal sandbox for building so Travis can share
$HOME/.cabal
- boot/configure only after the Shake build system is in place,
otherwise some required *.in files are not converted, and
Shake fails
>---------------------------------------------------------------
d0ffc1f8d7e109511b08c0a70a4956188718a911
.travis.yml | 52 +++++++++++++++++++++++++++----------
.travis/install-cabal-happy-alex.sh | 18 -------------
.travis/install-ghc-shake.sh | 19 --------------
.travis/install-ghc.sh | 12 ---------
.travis/print-env.sh | 9 -------
.travis/run-ghc-shake.sh | 9 -------
build.cabal.sh | 3 ++-
build.sh | 2 +-
8 files changed, 42 insertions(+), 82 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 5e169fa..9079fa9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,9 +1,23 @@
sudo: false
matrix:
- include:
- - env: CABALVER=1.22 GHCVER=7.10.3
- addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,zlib1g-dev,terminfo-dev], sources: [hvr-ghc]}}
+ include:
+ - env:
+ CABALVER=1.22
+ GHCVER=7.10.3
+
+ addons: {
+ apt: {
+ packages: [
+ ghc-7.10.3,
+ alex-3.1.4,
+ happy-1.19.5,
+ cabal-install-1.22,
+ zlib1g-dev
+ ],
+ sources: [hvr-ghc]
+ }
+ }
before_install:
@@ -12,21 +26,33 @@ before_install:
- PATH="/opt/cabal/$CABALVER/bin:$PATH"
- export PATH
- - .travis/print-env.sh
+ - env
+ - ghc --version
+ - cabal --version
+ - alex --version
+ - happy --version
+ - cabal update
install:
- - .travis/install-cabal-happy-alex.sh
- - .travis/install-ghc.sh
- - .travis/install-ghc-shake.sh
+
+ - travis_retry git clone git://git.haskell.org/ghc --recurse-submodules
+
+ # Travis clones the project into ".", but we need it as a child directory
+ # of "ghc/". For this reason, we - rather hackily - move the GHC-Shake
+ # ".git" directory into the appropriate location, and perform a hard reset
+ # in order to regenerate the GHC-Shake files.
+ - mkdir ghc/shake-build
+ - mv .git ghc/shake-build
+ - ( cd ghc/shake-build && git reset --hard HEAD )
+
+ - ( cd ghc/shake-build && cabal install --only-dependencies )
+
+ - ( cd ghc && ./boot )
+ - ( cd ghc && ./configure )
script:
- - .travis/run-ghc-shake.sh
+ - ./ghc/shake-build/build.sh -j --no-progress
cache:
directories:
- $HOME/.cabal
- # - ghc/shake-build/.cabal-sandbox
- # - ghc/shake-build/cabal.sandbox.config
-
-# before_cache:
-# - rm -rf ghc/shake-build
diff --git a/.travis/install-cabal-happy-alex.sh b/.travis/install-cabal-happy-alex.sh
deleted file mode 100755
index 93df460..0000000
--- a/.travis/install-cabal-happy-alex.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-COLOR="\e[32m" # Green
-RESET="\e[m"
-
-echo -e "${COLOR}GHC version:${RESET}"
-ghc --version
-
-echo -e "${COLOR}Cabal version:${RESET}"
-cabal --version
-
-echo -e "${COLOR}Update Cabal${RESET}"
-cabal update
-
-echo -e "${COLOR}Install Alex+Happy${RESET}"
-cabal install alex happy
diff --git a/.travis/install-ghc-shake.sh b/.travis/install-ghc-shake.sh
deleted file mode 100755
index c2b8774..0000000
--- a/.travis/install-ghc-shake.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-COLOR="\e[31m" # Red, because this file is serious business
-RESET="\e[m"
-
-echo -e "${COLOR}Brutally hacking GHC-Shake to its proper location${RESET}"
-SHAKEDIR="ghc/shake-build"
-mkdir -p "$SHAKEDIR"
-mv .git "$SHAKEDIR/"
-( cd "$SHAKEDIR" && git reset --hard HEAD )
-
-echo -e "${COLOR}Installing deps into sandbox${RESET}"
-( cd "$SHAKEDIR" && cabal sandbox init )
-( cd "$SHAKEDIR" && cabal install --only-dependencies . )
-
-echo -e "${COLOR}GHC boot/configure${RESET}"
-( cd ghc && ./boot && ./configure)
diff --git a/.travis/install-ghc.sh b/.travis/install-ghc.sh
deleted file mode 100755
index fc34ea4..0000000
--- a/.travis/install-ghc.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-COLOR="\e[34m" # Blue
-RESET="\e[m"
-
-echo -e "${COLOR}Clone GHC source${RESET}"
-git clone git://git.haskell.org/ghc
-
-echo -e "${COLOR}Initialize GHC submodules${RESET}"
-( cd ghc && git submodule update --init )
diff --git a/.travis/print-env.sh b/.travis/print-env.sh
deleted file mode 100755
index c09c11f..0000000
--- a/.travis/print-env.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-COLOR="\e[32m" # Green
-RESET="\e[m"
-
-echo -e "${COLOR}Environment:${RESET}"
-env
diff --git a/.travis/run-ghc-shake.sh b/.travis/run-ghc-shake.sh
deleted file mode 100755
index 7b867b7..0000000
--- a/.travis/run-ghc-shake.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-COLOR="\e[32m" # Green
-RESET="\e[m"
-
-echo -e "${COLOR}Running Shake build system${RESET}"
-( cd ghc && ./shake-build/build.cabal.sh )
diff --git a/build.cabal.sh b/build.cabal.sh
index 65da82b..cf165b8 100755
--- a/build.cabal.sh
+++ b/build.cabal.sh
@@ -6,9 +6,10 @@ absoltueRoot="$(dirname "$(readlink -f "$0")")"
cd "$absoltueRoot"
# Initialize sandbox if necessary
-if ! $(cabal sandbox hc-pkg list 2>&1 > /dev/null); then
+if ! ( cabal sandbox hc-pkg list 2>&1 > /dev/null ); then
cabal sandbox init
cabal install \
+ --dependencies-only \
--disable-library-profiling \
--disable-shared
fi
diff --git a/build.sh b/build.sh
index f09c30c..82cbb93 100755
--- a/build.sh
+++ b/build.sh
@@ -2,7 +2,7 @@
set -euo pipefail
-root="$(dirname "$0")"
+root="$(dirname "$(readlink -f "$0")")"
mkdir -p "$root/.shake"
More information about the ghc-commits
mailing list