summaryrefslogtreecommitdiff
path: root/.gitlab/ci.sh
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2021-02-13 11:41:47 +0800
committerMoritz Angermann <moritz.angermann@gmail.com>2021-02-13 11:41:47 +0800
commita7d22795ed118abfe64f4fc55d96d8561007ce1e (patch)
treedfb2d11fdf14fcb99bfaa2973c13d0222238ecd8 /.gitlab/ci.sh
parent6a01e28f4204ec17c587931311711fa76e0ea08d (diff)
downloadhaskell-a7d22795ed118abfe64f4fc55d96d8561007ce1e.tar.gz
[ci] Add support for building on aarch64-darwinwip/angerman/aarch64-darwin-ci
This will fail for now. But allows us to add aarch64-darwin machines to CI.
Diffstat (limited to '.gitlab/ci.sh')
-rwxr-xr-x.gitlab/ci.sh29
1 files changed, 17 insertions, 12 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 46b3e81129..36e1ae67b7 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -2,8 +2,7 @@
# shellcheck disable=SC2230
# This is the primary driver of the GitLab CI infrastructure.
-
-set -e -o pipefail
+set -Eeuo pipefail
# Configuration:
hackage_index_state="@1579718451"
@@ -118,12 +117,18 @@ function show_tool() {
function set_toolchain_paths() {
needs_toolchain=1
- case "$(uname)" in
- Linux) needs_toolchain="" ;;
+ case "$(uname -m)-$(uname)" in
+ *-Linux) needs_toolchain="" ;;
*) ;;
esac
- if [[ -n "$needs_toolchain" ]]; then
+ if [[ -n "${IN_NIX_SHELL:-}" ]]; then
+ needs_toolchain=""
+ GHC="$(which ghc)"
+ CABAL="$(which cabal)"
+ HAPPY="$(which happy)"
+ ALEX="$(which alex)"
+ elif [[ -n "$needs_toolchain" ]]; then
# These are populated by setup_toolchain
GHC="$toolchain/bin/ghc$exe"
CABAL="$toolchain/bin/cabal$exe"
@@ -135,6 +140,7 @@ function set_toolchain_paths() {
HAPPY="$HOME/.cabal/bin/happy"
ALEX="$HOME/.cabal/bin/alex"
fi
+
export GHC
export CABAL
export HAPPY
@@ -299,7 +305,6 @@ BUILD_SPHINX_HTML=$BUILD_SPHINX_HTML
BUILD_SPHINX_PDF=$BUILD_SPHINX_PDF
BeConservative=YES
INTEGER_LIBRARY=$INTEGER_LIBRARY
-XZ_CMD=$XZ
BuildFlavour=$BUILD_FLAVOUR
ifneq "\$(BuildFlavour)" ""
@@ -308,7 +313,7 @@ endif
GhcLibHcOpts+=-haddock
EOF
- if [ -n "$HADDOCK_HYPERLINKED_SOURCES" ]; then
+ if [ -n "${HADDOCK_HYPERLINKED_SOURCES:-}" ]; then
echo "EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump" >> mk/build.mk
fi
@@ -327,7 +332,7 @@ function configure() {
end_section "booting"
local target_args=""
- if [[ -n "$triple" ]]; then
+ if [[ -n "${triple:-}" ]]; then
target_args="--target=$triple"
fi
@@ -348,7 +353,7 @@ function build_make() {
if [[ -z "$BIN_DIST_PREP_TAR_COMP" ]]; then
fail "BIN_DIST_PREP_TAR_COMP is not set"
fi
- if [[ -n "$VERBOSE" ]]; then
+ if [[ -n "${VERBOSE:-}" ]]; then
MAKE_ARGS="$MAKE_ARGS V=1"
else
MAKE_ARGS="$MAKE_ARGS V=0"
@@ -373,7 +378,7 @@ function push_perf_notes() {
function test_make() {
run "$MAKE" test_bindist TEST_PREP=YES
- run "$MAKE" V=0 test \
+ run "$MAKE" V=0 VERBOSE=1 test \
THREADS="$cores" \
JUNIT_FILE=../../junit.xml
}
@@ -407,11 +412,11 @@ function clean() {
}
function run_hadrian() {
- if [ -n "$VERBOSE" ]; then HADRIAN_ARGS="$HADRIAN_ARGS -V"; fi
+ if [ -n "${VERBOSE:-}" ]; then HADRIAN_ARGS="${HADRIAN_ARGS:-} -V"; fi
run hadrian/build.cabal.sh \
--flavour="$FLAVOUR" \
-j"$cores" \
- $HADRIAN_ARGS \
+ ${HADRIAN_ARGS:-} \
$@
}