
Zubin pushed to branch wip/26296 at Glasgow Haskell Compiler / GHC Commits: 95b47966 by Zubin Duggal at 2025-08-18T12:43:33+05:30 ci: Teach ci.sh to fetch FreeBSD artifacts from ghcup unofficial bindists and bootstrap compiler on FreeBSD to 9.10.1 Fixes #26296 - - - - - 3 changed files: - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml Changes: ===================================== .gitlab/ci.sh ===================================== @@ -96,7 +96,9 @@ Environment variables determining bootstrap toolchain (Linux): Environment variables determining bootstrap toolchain (non-Linux): - GHC_VERSION Which GHC version to fetch for bootstrapping. + FETCH_GHC_VERSION Which GHC version to fetch for bootstrapping. + This should not be set if GHC is already provisioned, i.e. in the + docker image for linux platforms and via nix for darwin platforms CABAL_INSTALL_VERSION Cabal-install version to fetch for bootstrapping. EOF @@ -197,9 +199,6 @@ function set_toolchain_paths() { CABAL="$toolchain/bin/cabal$exe" HAPPY="$toolchain/bin/happy$exe" ALEX="$toolchain/bin/alex$exe" - if [ "$(uname)" = "FreeBSD" ]; then - GHC=/usr/local/bin/ghc - fi ;; nix) if [[ ! -f toolchain.sh ]]; then @@ -275,29 +274,50 @@ function setup() { } function fetch_ghc() { + local should_fetch=false + if [ ! -e "$GHC" ]; then - local v="$GHC_VERSION" - if [[ -z "$v" ]]; then - fail "neither GHC nor GHC_VERSION are not set" + if [ -z "${FETCH_GHC_VERSION:-}" ]; then + fail "GHC not found at '$GHC' and FETCH_GHC_VERSION is not set" + fi + should_fetch=true + elif [ -n "${FETCH_GHC_VERSION:-}" ]; then + local current_version + if current_version=$($GHC --numeric-version 2>/dev/null); then + if [ "$current_version" != "$FETCH_GHC_VERSION" ]; then + info "GHC version mismatch: found $current_version, expected $FETCH_GHC_VERSION" + should_fetch=true fi + fi + fi + + if [ "$should_fetch" = true ]; then + local v="$FETCH_GHC_VERSION" start_section fetch-ghc "Fetch GHC" - url="https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-${boot_triple}.tar.xz" + case "$(uname)" in + FreeBSD) + url="https://downloads.haskell.org/ghcup/unofficial-bindists/ghc/${FETCH_GHC_VERSION}/ghc-${FETCH_GHC_VERSION}-${boot_triple}.tar.xz" + ;; + *) + url="https://downloads.haskell.org/~ghc/${FETCH_GHC_VERSION}/ghc-${FETCH_GHC_VERSION}-${boot_triple}.tar.xz" + ;; + esac info "Fetching GHC binary distribution from $url..." curl "$url" > ghc.tar.xz || fail "failed to fetch GHC binary distribution" $TAR -xJf ghc.tar.xz || fail "failed to extract GHC binary distribution" case "$(uname)" in MSYS_*|MINGW*) - cp -r ghc-${GHC_VERSION}*/* "$toolchain" + cp -r ghc-${FETCH_GHC_VERSION}*/* "$toolchain" ;; *) - pushd ghc-${GHC_VERSION}* + pushd ghc-${FETCH_GHC_VERSION}* ./configure --prefix="$toolchain" "$MAKE" install popd ;; esac - rm -Rf "ghc-${GHC_VERSION}" ghc.tar.xz + rm -Rf "ghc-${FETCH_GHC_VERSION}" ghc.tar.xz end_section fetch-ghc fi ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -446,7 +446,7 @@ opsysVariables _ FreeBSD14 = mconcat -- Prefer to use the system's clang-based toolchain and not gcc , "CC" =: "cc" , "CXX" =: "c++" - , "GHC_VERSION" =: "9.6.4" + , "FETCH_GHC_VERSION" =: "9.10.1" , "CABAL_INSTALL_VERSION" =: "3.10.3.0" ] opsysVariables arch (Linux distro) = distroVariables arch distro @@ -478,7 +478,7 @@ opsysVariables _ (Windows {}) = mconcat , "LANG" =: "en_US.UTF-8" , "CABAL_INSTALL_VERSION" =: "3.10.2.0" , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs" - , "GHC_VERSION" =: "9.10.1" + , "FETCH_GHC_VERSION" =: "9.10.1" ] opsysVariables _ _ = mempty ===================================== .gitlab/jobs.yaml ===================================== @@ -1467,7 +1467,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "GHC_VERSION": "9.6.4", + "FETCH_GHC_VERSION": "9.10.1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-freebsd14-validate", @@ -3698,7 +3698,7 @@ "BUILD_FLAVOUR": "validate", "CABAL_INSTALL_VERSION": "3.10.2.0", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.1", "HADRIAN_ARGS": "--docs=no-sphinx-pdfs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "LANG": "en_US.UTF-8", @@ -3761,7 +3761,7 @@ "BUILD_FLAVOUR": "validate", "CABAL_INSTALL_VERSION": "3.10.2.0", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.1", "HADRIAN_ARGS": "--docs=no-sphinx-pdfs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "LANG": "en_US.UTF-8", @@ -4355,7 +4355,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "GHC_VERSION": "9.6.4", + "FETCH_GHC_VERSION": "9.10.1", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", @@ -5579,7 +5579,7 @@ "BUILD_FLAVOUR": "release", "CABAL_INSTALL_VERSION": "3.10.2.0", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.1", "HADRIAN_ARGS": "--docs=no-sphinx-pdfs", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", @@ -5643,7 +5643,7 @@ "BUILD_FLAVOUR": "release", "CABAL_INSTALL_VERSION": "3.10.2.0", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.1", "HADRIAN_ARGS": "--docs=no-sphinx-pdfs", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", @@ -5782,7 +5782,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "GHC_VERSION": "9.6.4", + "FETCH_GHC_VERSION": "9.10.1", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-freebsd14-validate" @@ -7982,7 +7982,7 @@ "BUILD_FLAVOUR": "validate", "CABAL_INSTALL_VERSION": "3.10.2.0", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.1", "HADRIAN_ARGS": "--docs=no-sphinx-pdfs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "LANG": "en_US.UTF-8", @@ -8044,7 +8044,7 @@ "BUILD_FLAVOUR": "validate", "CABAL_INSTALL_VERSION": "3.10.2.0", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.1", "HADRIAN_ARGS": "--docs=no-sphinx-pdfs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "LANG": "en_US.UTF-8", View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/95b479662a76f08a1391012492cb471f... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/95b479662a76f08a1391012492cb471f... You're receiving this email because of your account on gitlab.haskell.org.