Skip to content

Update release CI scripts (boot compiler and platform support) #11032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ on:
env:
# We choose a stable ghc version across all os's
# which will be used to do the next release
GHC_FOR_RELEASE: "9.4.8"
GHC_FOR_RELEASE: "9.10.2"
# Ideally we should use the version about to be released for hackage tests and benchmarks
GHC_FOR_SOLVER_BENCHMARKS: "9.4.8"
GHC_FOR_COMPLETE_HACKAGE_TESTS: "9.4.8"
GHC_FOR_SOLVER_BENCHMARKS: "9.10.2"
GHC_FOR_COMPLETE_HACKAGE_TESTS: "9.10.2"
COMMON_FLAGS: "-j 2 -v"

# See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#hackage-revisions
Expand All @@ -61,7 +61,7 @@ jobs:
ghc:
[
"9.12.2",
"9.10.1",
"9.10.2",
"9.8.4",
"9.6.7",
"9.4.8",
Expand Down
30 changes: 8 additions & 22 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ stages:

variables:
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: "a9297a370025101b479cfd4977f8f910814e03ab"
DOCKER_REV: "df20b2eb2fcc1c93aed5ad047c65752fbd4c38d4"

GHC_VERSION: 9.6.4
CABAL_INSTALL_VERSION: 3.10.2.0
GHC_VERSION: 9.10.2
CABAL_INSTALL_VERSION: 3.14.2.0

workflow:
rules:
Expand All @@ -33,30 +33,20 @@ linux:
- ARCH: i386
TAG: x86_64-linux
OS:
- deb9
- deb10
- ARCH: x86_64
TAG: x86_64-linux
OS:
- deb9
- deb10
- deb11
- deb12
- fedora33
- fedora36
- fedora38
- rocky8
- ubuntu18_04
- ubuntu20_04
- ubuntu22_04
# Pull this one from the future, since it's missing.
# We can't move the entire file to this DOCKER_REV, because
# i386-linux-deb9 is missing from it.
- ARCH: x86_64
TAG: x86_64-linux
OS: centos7
DOCKER_REV: f2d12519f45a13a61fcca03a949f927ceead6492

- ubuntu24_04
- ARCH: aarch64
TAG: aarch64-linux
OS:
Expand All @@ -76,12 +66,11 @@ alpine-linux:
extends: .build
parallel:
matrix:
- ARCH: [i386, x86_64]
OS: [alpine3_12, alpine3_15, alpine3_17]
- ARCH: [x86_64]
OS: [alpine3_12, alpine3_20]
TAG: x86_64-linux
# Was 3_18 for i386 intentionally left off?
- ARCH: x86_64
OS: alpine3_18
- ARCH: [i386]
OS: alpine3_20
TAG: x86_64-linux
- ARCH: [aarch64]
OS: [alpine3_18]
Expand Down Expand Up @@ -110,9 +99,6 @@ darwin:
tags:
- ${ARCH}-darwin-m1
variables:
# Using 9.8.2 to work around
# https://gitlab.haskell.org/ghc/ghc/-/issues/24050
GHC_VERSION: 9.8.2
TARBALL_ARCHIVE_SUFFIX: ${ARCH}-darwin
TARBALL_EXT: tar.xz
ADD_CABAL_ARGS: ""
Expand Down
72 changes: 61 additions & 11 deletions .gitlab/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,70 @@ set -Eeuo pipefail

source "$CI_PROJECT_DIR/.gitlab/common.sh"

## Figure out how to get the Haskell toolchain.

# For backport, the centos image no longer has the right GHC version, so use
# ghcup.
if [[ -f /etc/os-release && "$(grep ^ID /etc/os-release)" =~ "centos" ]]; then
. "$CI_PROJECT_DIR/.gitlab/ghcup.sh"
# All the other ones are fine.
elif [[ "$(uname)" == "Linux" ]]; then
export PATH="/opt/ghc/${GHC_VERSION}/bin:${PATH}"
# Not all runners use ci-images, so ghcup is used.
# Required arguments to the script
: "${GHC_VERSION:?Need to set GHC_VERSION}"
: "${CABAL_INSTALL_VERSION:?Need to set CABAL_INSTALL_VERSION}"

# If GHC is set, extract its directory and add it to PATH
# The linux images set the GHC variable to specify the location of the GHC installation.
if [[ -n "${GHC:-}" ]]; then
echo "GHC variable is set to: $GHC"
export PATH="$(dirname "$GHC"):$PATH"
else
GHC="ghc"
fi

echo "Checking toolchain versions..."

# GHC check
ghc_version_ok=false
if command -v ghc &>/dev/null; then
current_ghc_version=$(ghc --numeric-version)
if [[ "$current_ghc_version" == "$GHC_VERSION" ]]; then
ghc_version_ok=true
else
echo "Wrong GHC version: found $current_ghc_version, expected $GHC_VERSION"
fi
else
. "$CI_PROJECT_DIR/.gitlab/ghcup.sh"
echo "GHC executable '$GHC' not found on PATH"
fi

# cabal check
cabal_version_ok=false
if command -v cabal &>/dev/null; then
current_cabal_version=$(cabal --numeric-version)
if [[ "$current_cabal_version" == "$CABAL_INSTALL_VERSION" ]]; then
cabal_version_ok=true
else
echo "Wrong cabal version: found $current_cabal_version, expected $CABAL_INSTALL_VERSION"
fi
else
echo "cabal not found on PATH"
fi

# If either is wrong, install via ghcup
if ! $ghc_version_ok || ! $cabal_version_ok; then
echo "Installing correct GHC and/or cabal via ghcup..."
. "$CI_PROJECT_DIR/.gitlab/ghcup.sh"
fi

# Final verification (ghc and cabal must now be on PATH)
echo "Verifying installed versions..."

actual_ghc_version=$(ghc --numeric-version)
actual_cabal_version=$(cabal --numeric-version)

if [[ "$actual_ghc_version" != "$GHC_VERSION" ]]; then
fail "Incorrect GHC version (actual: $actual_ghc_version, expected: $GHC_VERSION)"
fi

if [[ "$actual_cabal_version" != "$CABAL_INSTALL_VERSION" ]]; then
fail "Incorrect cabal version (actual: $actual_cabal_version, expected: $CABAL_INSTALL_VERSION)"
fi

echo "Using GHC version: $actual_ghc_version"
echo "Using cabal-install version: $actual_cabal_version"

export CABAL_DIR="$CI_PROJECT_DIR/cabal"

case "$(uname)" in
Expand Down
Loading