summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-09-15 12:07:08 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-08 22:45:27 -0500
commit0a76d7d415cfa8facfa6d36101210f9e2e3ff0a6 (patch)
treeb58f457ee873c8b68da8f9038024cedbaa0bd345
parent5d0a311f28b96e8be2e051ae8cb08cc654d0b63e (diff)
downloadhaskell-0a76d7d415cfa8facfa6d36101210f9e2e3ff0a6.tar.gz
ci: Add job for testing interface stability across builds
The idea is that both the bindists should product libraries with the same ABI and interface hash. So the job checks with ghc-pkg to make sure the computed ABI is the same. In future this job can be extended to check for the other facets of interface determinism. Fixes #22180
-rw-r--r--.gitlab-ci.yml27
-rwxr-xr-x.gitlab/ci.sh17
2 files changed, 44 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f6ef3e2c3f..d9c7ff1761 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -405,6 +405,33 @@ test-cabal-reinstall-x86_64-linux-deb10:
rules:
- if: $NIGHTLY
+########################################
+# Testing ABI is invariant across builds
+########################################
+
+abi-test-nightly:
+ stage: full-build
+ needs:
+ - job: nightly-x86_64-linux-fedora33-release-hackage
+ - job: nightly-x86_64-linux-fedora33-release
+ tags:
+ - x86_64-linux
+ image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-fedora33:$DOCKER_REV"
+ dependencies: null
+ before_script:
+ - mkdir -p normal
+ - mkdir -p hackage
+ - tar -xf ghc-x86_64-linux-fedora33-release.tar.xz -C normal/
+ - tar -xf ghc-x86_64-linux-fedora33-release-hackage_docs.tar.xz -C hackage/
+ script:
+ - .gitlab/ci.sh compare_interfaces_of "normal/ghc-*" "hackage/ghc-*"
+ artifacts:
+ paths:
+ - out
+ rules:
+ - if: $NIGHTLY
+ - if: '$RELEASE_JOB == "yes"'
+
############################################################
# Packaging
############################################################
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh
index 5a9097aaab..bce606f679 100755
--- a/.gitlab/ci.sh
+++ b/.gitlab/ci.sh
@@ -801,6 +801,22 @@ function lint_author(){
done
}
+function abi_of(){
+ DIR=$(realpath $1)
+ mkdir -p "$OUT"
+ pushd $DIR
+ summarise_hi_files
+ popd
+}
+
+# Checks that the interfaces in folder $1 match the interfaces in folder $2
+function compare_interfaces_of(){
+ OUT=$PWD/out/run1 abi_of $1
+ OUT=$PWD/out/run2 abi_of $2
+ check_interfaces out/run1 out/run2 abis "Mismatched ABI hash"
+ check_interfaces out/run1 out/run2 interfaces "Mismatched interface hashes"
+}
+
setup_locale
@@ -899,6 +915,7 @@ case $1 in
abi_test) abi_test ;;
cabal_test) cabal_test ;;
lint_author) shift; lint_author "$@" ;;
+ compare_interfaces_of) shift; compare_interfaces_of "$@" ;;
clean) clean ;;
save_cache) save_cache ;;
shell) shift; shell "$@" ;;