[Git][ghc/ghc][wip/jeltsch/ghc-9-14-building-base] Add tests for `base` being buildable with released GHCs
Wolfgang Jeltsch pushed to branch wip/jeltsch/ghc-9-14-building-base at Glasgow Haskell Compiler / GHC Commits: a50ca6c6 by Wolfgang Jeltsch at 2026-11-20T14:21:16+02:00 Add tests for `base` being buildable with released GHCs - - - - - 2 changed files: - .gitlab-ci.yml - + .gitlab/base-ci.sh Changes: ===================================== .gitlab-ci.yml ===================================== @@ -68,7 +68,7 @@ stages: - tool-lint # Source linting of the tools - quick-build # A very quick smoke-test to weed out broken commits - full-build # Build all the things - - testing # head.hackage correctness and compiler performance testing + - testing # Various tests - packaging # Source distribution, etc. - deploy # push documentation @@ -1156,6 +1156,44 @@ ghc-wasm-meta-unreg: UPSTREAM_GHC_FLAVOUR: unreg UPSTREAM_GHC_JOB_NAME: x86_64-linux-alpine3_23-wasm-unreg-cross_wasm32-wasi-release+host_fully_static+text_simdutf +############################################################ +# Testing the compatibility of `base` with other GHCs +############################################################ + +base-with-other-ghcs-linux: + stage: testing + needs: + - job: x86_64-linux-deb13-validate + optional: true + - job: nightly-x86_64-linux-deb13-validate + optional: true + - job: release-x86_64-linux-deb13-release + optional: true + dependencies: null + image: debian:13 + tags: + - x86_64-linux + script: .gitlab/base-ci.sh x86_64-deb13-linux 9.14.1 + rules: + - *full-ci + +base-with-other-ghcs-windows: + stage: testing + needs: + - job: x86_64-windows-validate + optional: true + - job: nightly-x86_64-windows-validate + optional: true + - job: release-x86_64-windows-release + optional: true + dependencies: null + image: null + tags: + - new-x86_64-windows + script: bash .gitlab/base-ci.sh x86_64-unknown-mingw32 9.14.1 + rules: + - *full-ci + ############################################################ # Documentation deployment via GitLab Pages ############################################################ ===================================== .gitlab/base-ci.sh ===================================== @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +# This script supports testing the compatibility of the in-tree `base` with +# different non-in-tree GHCs. We deliberately use a script separate from +# `.gitlab/ci.sh` for this purpose, because such support is supposed to become +# part of the CI infrastructure of a separately maintained `base`. +# +# Currently, this script can only test that the in-tree `base` can be *built* +# with certain *released* GHCs. +# +# This script can run on both Unix and Windows. Since GHC’s CI infrastructure +# does not offer Cabal pre-installed on Windows, this script uses a `Setup.hs` +# file to build `base`, which works across operating systems. + +# Establish error propagation +set -e -o pipefail + +# Process arguments +if [ $# -lt 1 ] +then + echo 'Build `base` with released GHCs' + echo "Usage: base-ci ⟨platform⟩ ⟨ghc-version⟩ …" + exit 1 +fi >&2 +platform=$1 +shift +ghc_versions=$* + +# Save project root +project_root=$PWD + +# Create directories for other GHCs +mkdir other-ghcs +mkdir other-ghcs/src +mkdir other-ghcs/opt + +# Amend the `base` sources +cd libraries/base +sed -E -e 's/^( *ghc-internal)[^[:alnum:]-].*(,|$)/\1\2/' \ + < base.cabal.in \ + > base.cabal +cat <<. >Setup.hs +import Distribution.Simple +main = defaultMain +. +cd "${project_root}" + +# Build `base` with the different GHCs +for ghc_version in ${ghc_versions} +do + # Install the GHC + ghc_installation=${project_root}/other-ghcs/opt/${ghc_version} + cd other-ghcs/src + archive_file=ghc-${ghc_version}-${platform}.tar.xz + curl https://downloads.haskell.org/~ghc/${ghc_version}/${archive_file} \ + >${ghc_version}.tar.xz + tar -xJf ${ghc_version}.tar.xz + if [ -f ghc-${ghc_version}-*/configure ] + then # Unix + cd ghc-${ghc_version}-* + ./configure --prefix "${ghc_installation}" + make install + else # Windows + mv ghc-${ghc_version}-* "${ghc_installation}" + fi + cd "${project_root}" + + # Build `base` with the installed GHC + cd libraries/base + "${ghc_installation}/bin/runghc" Setup.hs configure \ + --with-compiler "${ghc_installation}/bin/ghc" \ + --disable-optimization + "${ghc_installation}/bin/runghc" Setup.hs build + cd "${project_root}" +done View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a50ca6c64cf263c94561628729315d67... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a50ca6c64cf263c94561628729315d67... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Wolfgang Jeltsch (@jeltsch)