Wolfgang Jeltsch pushed to branch wip/jeltsch/ghc-9-14-building-base at Glasgow Haskell Compiler / GHC Commits: 1440bf4c by Wolfgang Jeltsch at 2026-09-03T15:11:06+03:00 Switch to using a `Setup.hs` file - - - - - 1 changed file: - .gitlab/base-ci.sh Changes: ===================================== .gitlab/base-ci.sh ===================================== @@ -7,6 +7,10 @@ # # 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 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 @@ -22,25 +26,30 @@ 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 -# Save project root -project_root=$PWD - -# Create Cabal file for `base` +# 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} \ @@ -49,18 +58,18 @@ do if [ -f ghc-${ghc_version}-*/configure ] then # Unix cd ghc-${ghc_version}-* - ./configure --prefix "${project_root}/other-ghcs/opt/${ghc_version}" + ./configure --prefix "${ghc_installation}" make install else # Windows - mv ghc-${ghc_version}-* "${project_root}/other-ghcs/opt/${ghc_version}" + mv ghc-${ghc_version}-* "${ghc_installation}" fi cd ${project_root} # Build `base` with the installed GHC cd libraries/base - cabal build \ - --with-compiler "${project_root}/other-ghcs/opt/${ghc_version}/bin/ghc" \ - --allow-boot-library-installs \ + "${ghc_installation}/bin/runghc" Setup.hs configure \ + --with-compiler "${ghc_installation}/bin/ghc" \ -O0 + "${ghc_installation}/bin/runghc" Setup.hs build cd ${project_root} done View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1440bf4cb944edb80ebc32a8135e0905... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1440bf4cb944edb80ebc32a8135e0905... 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)