diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-03-08 15:52:02 -0500 |
---|---|---|
committer | Zubin Duggal <zubin.duggal@gmail.com> | 2022-05-25 19:03:35 +0530 |
commit | d487022f888ce336bbefe22a4b3734e72cfcaea1 (patch) | |
tree | 5f885fb6971211281501f0295600ae2391afe9ff | |
parent | 243e6c44e95a9462844f73f394fe6a5dc3e4145a (diff) | |
download | haskell-d487022f888ce336bbefe22a4b3734e72cfcaea1.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)
-rwxr-xr-x | .gitlab/ci.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 30dd0ff757..24de6cead4 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -445,6 +445,17 @@ function determine_metric_baseline() { info "Using $PERF_BASELINE_COMMIT for performance metric baseline..." } +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 @@ -466,6 +477,7 @@ function test_make() { return fi + check_msys2_deps inplace/bin/ghc-stage2 --version check_release_build run "$MAKE" test_bindist TEST_PREP=YES @@ -496,6 +508,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 |