summaryrefslogtreecommitdiff
path: root/.gitlab
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-03-08 15:52:02 -0500
committerBen Gamari <ben@smart-cactus.org>2022-05-18 11:16:59 -0400
commitf815b6555a79449e7e240e0f15c773ecbdbfa79c (patch)
tree39342dd85772e3c256c4aae6a7156d4142aa9199 /.gitlab
parent5fbc3947b0fddf654cdbf40eb213b2abd469ee71 (diff)
downloadhaskell-f815b6555a79449e7e240e0f15c773ecbdbfa79c.tar.gz
gitlab-ci: Check for dynamic msys2 dependencies
Both #20878 and #21196 were caused by unwanted dynamic dependencies being introduced by boot libraries. Ensure that we catch this in CI by attempting to run GHC in an environment with a minimal PATH. (cherry picked from commit fcc7dc4c2848d46439bcbfae3f9eaf0a1f400ab4)
Diffstat (limited to '.gitlab')
-rwxr-xr-x.gitlab/ci.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index d9e48129a8..3bdec79b13 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -469,6 +469,17 @@ function determine_metric_baseline() {
fi
}
+function check_msys2_deps() {
+ # Ensure that GHC on Windows doesn't have any dynamic dependencies on msys2
+ case "$(uname)" in
+ MSYS_*|MINGW*)
+ sysroot="$(cygpath "$SYSTEMROOT")"
+ PATH="$sysroot/System32:$sysroot;$sysroot/Wbem" $@ \
+ || fail "'$@' failed; there may be unwanted dynamic dependencies."
+ ;;
+ esac
+}
+
# If RELEASE_JOB = yes then we skip builds with a validate flavour.
# This has the effect of
# (1) Skipping validate jobs when trying to do release builds
@@ -490,6 +501,7 @@ function test_make() {
return
fi
+ check_msys2_deps inplace/bin/ghc-stage2 --version
check_release_build
run "$MAKE" test_bindist TEST_PREP=YES TEST_PROF=${RELEASE_JOB:-}
@@ -529,6 +541,7 @@ function test_hadrian() {
return
fi
+ check_msys2_deps _build/stage1/bin/ghc --version
check_release_build
# Ensure that statically-linked builds are actually static