summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-07-25 15:50:16 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-23 16:00:17 -0400
commitbe11120f56ebe7fa28bc362056733b35ae932e1e (patch)
tree1ed34c5ff5960a986d7cf7b89fa0cf138725fb05 /.gitlab-ci.yml
parent55112fbfe6d1fad61b27780d3361a330359d48b3 (diff)
downloadhaskell-be11120f56ebe7fa28bc362056733b35ae932e1e.tar.gz
ci: More surgical use of nix in Darwin builds
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml96
1 files changed, 31 insertions, 65 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5b7a21b183..d0c5b6315b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -542,6 +542,7 @@ validate-x86_64-darwin:
allow_failure: true
variables:
+ BUILD_FLAVOUR: "validate"
GHC_VERSION: 8.10.4
CABAL_INSTALL_VERSION: 3.2.0.0
BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-apple-darwin.tar.xz"
@@ -559,55 +560,35 @@ validate-x86_64-darwin:
CPUS: 8
LANG: "en_US.UTF-8"
# WARNING: this is overridden in the shell.nix, see shell.nix!
- CONFIGURE_ARGS: "--with-intree-gmp"
+ CONFIGURE_ARGS: "--with-intree-gmp --with-system-libffi"
HADRIAN_ARGS: "--docs=no-sphinx"
TEST_ENV: "x86_64-darwin-hadrian"
- BIN_DIST_NAME: "ghc-amd64-apple-darwin"
- BUILD_FLAVOUR: "validate"
+ BIN_DIST_NAME: "ghc-x86_64-apple-darwin"
+ # Capi_Ctype_001 Capi_Ctype_002 T12010: Due to #20393
+ BROKEN_TESTS: "Capi_Ctype_001 Capi_Ctype_002 T12010"
# Due to #19025
IGNORE_PERF_FAILURES: "all"
after_script:
- .gitlab/ci.sh clean
- cat ci-timings
- # I wish we could just use the nix #! logic, but we can't --run and -i bash
- # behave very differently. -i bash does not pass any nix related env vars
- # the whole $stdenv/setup part seems to be missing.
script: |
- set -Eeuo pipefail
- function runInNixShell() {
- time nix-shell .gitlab/shell.nix \
- -I nixpkgs=https://github.com/angerman/nixpkgs/archive/75f7281738b.tar.gz \
- --argstr system "x86_64-darwin" \
- --pure \
- --keep GHC_VERSION --keep CABAL_INSTALL_VERSION --keep BUILD_FLAVOUR \
- --keep BIN_DIST_PREP_TAR_COMP --keep CPUS --keep PROJECT_DIR \
- --keep CI_PROJECT_DIR --keep MAKE_ARGS --keep HADRIAN_ARGS --keep HOME \
- --keep LANG --keep CONFIGURE_ARGS --keep TEST_ENV --keep BIN_DIST_NAME \
- --keep MACOSX_DEPLOYMENT_TARGET --keep ac_cv_func_clock_gettime --keep HACKAGE_INDEX_STATE \
- --keep PERF_NOTE_KEY --keep HEAD_HACKAGE_TRIGGER_TOKEN \
- --run "$1" 2>&1
- }
- # make sure home exists
- export HOME=$HOME/x86_64-home
- mkdir -p $HOME
+ nix build -f .gitlab/darwin/toolchain.nix --argstr system x86_64-darwin -o toolchain.sh
+ source toolchain.sh
+ cat toolchain.sh
+
+ sdk_path="$(xcrun --sdk macosx --show-sdk-path)"
+ CONFIGURE_ARGS="$CONFIGURE_ARGS --with-ffi-libraries=$sdk_path/usr/lib --with-ffi-includes=$sdk_path/usr/include/ffi"
# fix up config.sub in libraries for the time.
# aarch64-darwin is not supported in older config.sub's
find libraries -name config.sub -exec cp config.sub {} \;
- runInNixShell ".gitlab/ci.sh setup"
-
- # make sure $HOME is prisine
- echo "Deleting $HOME/.cabal"
- rm -fR $HOME/.cabal
- runInNixShell "cabal update --index=$HACKAGE_INDEX_STATE"
- runInNixShell ".gitlab/ci.sh configure"
- runInNixShell ".gitlab/ci.sh build_hadrian"
- runInNixShell ".gitlab/ci.sh test_hadrian"
-
- # Important to run this in nix-shell because $HOME is different in there
- runInNixShell ".gitlab/ci.sh save_cache"
+ .gitlab/ci.sh setup
+ .gitlab/ci.sh configure
+ .gitlab/ci.sh build_hadrian
+ .gitlab/ci.sh test_hadrian
+ .gitlab/ci.sh save_cache
artifacts:
when: always
@@ -622,11 +603,11 @@ validate-aarch64-darwin:
- aarch64-darwin-m1
variables:
+ BUILD_FLAVOUR: "validate"
TEST_TYPE: test
MAKE_ARGS: "-Werror"
GHC_VERSION: 8.10.3
CABAL_INSTALL_VERSION: 3.2.0.0
- BUILD_FLAVOUR: "perf"
BIN_DIST_PREP_TAR_COMP: "ghc-arm64-apple-darwin.tar.xz"
# we run on M1's for now, getconf can't be built with nix yet,
# and we use a pure shell, so we can't/shouldn't use /usr/bin/getconf
@@ -634,10 +615,12 @@ validate-aarch64-darwin:
CPUS: 8
LANG: "en_US.UTF-8"
# WARNING: this is overridden in the shell.nix, see shell.nix!
- CONFIGURE_ARGS: "--with-intree-gmp"
+ CONFIGURE_ARGS: "--with-intree-gmp --with-system-libffi"
HADRIAN_ARGS: "--docs=no-sphinx"
BIN_DIST_NAME: "ghc-arm64-apple-darwin"
TEST_ENV: "aarch64-darwin-hadrian"
+ # Capi_Ctype_001 Capi_Ctype_002 T12010: Due to #20393
+ BROKEN_TESTS: "Capi_Ctype_001 Capi_Ctype_002 T12010"
after_script:
- .gitlab/ci.sh clean
- cat ci-timings
@@ -646,39 +629,22 @@ validate-aarch64-darwin:
# behave very differently. -i bash does not pass any nix related env vars
# the whole $stdenv/setup part seems to be missing.
script: |
- set -Eeuo pipefail
- function runInNixShell() {
- time nix-shell .gitlab/shell.nix \
- -I nixpkgs=https://github.com/angerman/nixpkgs/archive/75f7281738b.tar.gz \
- --argstr system "aarch64-darwin" \
- --pure \
- --keep GHC_VERSION --keep CABAL_INSTALL_VERSION --keep BUILD_FLAVOUR \
- --keep BIN_DIST_PREP_TAR_COMP --keep CPUS --keep PROJECT_DIR \
- --keep CI_PROJECT_DIR --keep MAKE_ARGS --keep HADRIAN_ARGS --keep HOME \
- --keep LANG --keep CONFIGURE_ARGS --keep TEST_ENV --keep BIN_DIST_NAME \
- --keep HACKAGE_INDEX_STATE \
- --run "$1" 2>&1
- }
- export HOME=$HOME/arm64-home
- # make sure home exists
- mkdir -p $HOME
+ nix build -f .gitlab/darwin/toolchain.nix --argstr system aarch64-darwin -o toolchain.sh
+ source toolchain.sh
+ cat toolchain.sh
+
+ sdk_path="$(xcrun --sdk macosx --show-sdk-path)"
+ CONFIGURE_ARGS="$CONFIGURE_ARGS --with-ffi-libraries=$sdk_path/usr/lib --with-ffi-includes=$sdk_path/usr/include/ffi"
# fix up config.sub in libraries for the time.
# aarch64-darwin is not supported in older config.sub's
find libraries -name config.sub -exec cp config.sub {} \;
- runInNixShell ".gitlab/ci.sh setup"
-
- # make sure $HOME is prisine
- echo "Deleting $HOME/.cabal"
- rm -fR $HOME/.cabal
- runInNixShell "cabal update --index=$HACKAGE_INDEX_STATE"
- runInNixShell ".gitlab/ci.sh configure"
- runInNixShell ".gitlab/ci.sh build_hadrian"
- runInNixShell ".gitlab/ci.sh test_hadrian"
-
- # Important to run this in nix-shell because $HOME is different there
- runInNixShell ".gitlab/ci.sh save_cache"
+ .gitlab/ci.sh setup
+ .gitlab/ci.sh configure
+ .gitlab/ci.sh build_hadrian
+ .gitlab/ci.sh test_hadrian
+ .gitlab/ci.sh save_cache
artifacts:
when: always