Skip to content

Commit ff7bf03

Browse files
authored
Merge pull request #9865 from chreekat/b/new-ci-images
GitLab CI: Shake up available platforms
2 parents 00ce024 + 1f60a97 commit ff7bf03

File tree

3 files changed

+84
-81
lines changed

3 files changed

+84
-81
lines changed

.gitlab-ci.yml

Lines changed: 39 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ stages:
33

44
variables:
55
# Commit of ghc/ci-images repository from which to pull Docker images
6-
DOCKER_REV: "572353e0644044fe3a5465bba4342a9a0b0eb60e"
6+
DOCKER_REV: "a9297a370025101b479cfd4977f8f910814e03ab"
77

8-
GHC_VERSION: 9.2.3
9-
CABAL_INSTALL_VERSION: 3.6.2.0
8+
GHC_VERSION: 9.6.4
9+
CABAL_INSTALL_VERSION: 3.10.2.0
1010

1111
workflow:
1212
rules:
@@ -26,30 +26,36 @@ workflow:
2626
paths:
2727
- out/*
2828

29-
build-linux:
29+
linux:
3030
extends: .build
3131
parallel:
3232
matrix:
3333
- ARCH: i386
3434
TAG: x86_64-linux
3535
OS:
3636
- deb9
37+
- deb10
3738
- ARCH: x86_64
3839
TAG: x86_64-linux
3940
OS:
4041
- centos7
4142
- deb9
43+
- deb10
44+
- deb11
45+
- deb12
4246
- fedora33
47+
- fedora36
48+
- fedora38
4349
- rocky8
4450
- ubuntu18_04
4551
- ubuntu20_04
46-
- deb10
47-
- deb11
52+
- ubuntu22_04
4853
- ARCH: aarch64
4954
TAG: aarch64-linux
5055
OS:
5156
- deb10
5257
- deb11
58+
- deb12
5359
tags:
5460
- $TAG
5561
image: "registry.gitlab.haskell.org/ghc/ci-images/$PLATFORM:$DOCKER_REV"
@@ -59,17 +65,22 @@ build-linux:
5965
TARBALL_EXT: tar.xz
6066
ADD_CABAL_ARGS: "--enable-split-sections"
6167

62-
build-linux-alpine:
68+
alpine-linux:
6369
extends: .build
6470
parallel:
6571
matrix:
66-
- ARCH: i386
67-
OS: [alpine3_12]
68-
GHC_VERSION: 9.0.2
72+
- ARCH: [i386, x86_64]
73+
OS: [alpine3_12, alpine3_15, alpine3_17]
74+
TAG: x86_64-linux
75+
# Was 3_18 for i386 intentionally left off?
6976
- ARCH: x86_64
70-
OS: [alpine3_12]
77+
OS: alpine3_18
78+
TAG: x86_64-linux
79+
- ARCH: [aarch64]
80+
OS: [alpine3_18]
81+
TAG: aarch64-linux
7182
tags:
72-
- x86_64-linux
83+
- $TAG
7384
before_script:
7485
# for cabal build
7586
- sudo apk add --no-cache zlib zlib-dev zlib-static
@@ -80,50 +91,28 @@ build-linux-alpine:
8091
TARBALL_EXT: tar.xz
8192
ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static"
8293

83-
build-x86_64-darwin:
94+
darwin:
8495
extends: .build
96+
parallel:
97+
matrix:
98+
# Help me with names pls
99+
- ARCH: x86_64
100+
ARCHARCH: x86_64
101+
- ARCH: aarch64
102+
ARCHARCH: arm64
85103
tags:
86-
- x86_64-darwin
87-
variables:
88-
TARBALL_ARCHIVE_SUFFIX: x86_64-darwin
89-
TARBALL_EXT: tar.xz
90-
ADD_CABAL_ARGS: ""
91-
92-
build-aarch64-darwin:
93-
stage: build
94-
tags:
95-
- aarch64-darwin-m1
96-
before_script:
97-
- export HOMEBREW_CHANGE_ARCH_TO_ARM=1
98-
- arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree
99-
# C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
100-
script: |
101-
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
102-
export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
103-
export CXX=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang++
104-
export LD=ld
105-
export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
106-
export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
107-
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"
108-
arch -arm64 /bin/bash ./.gitlab/ci.sh
109-
after_script:
110-
- rm -Rf /private/tmp/.brew_tmp
104+
- ${ARCH}-darwin-m1
111105
variables:
112-
MACOSX_DEPLOYMENT_TARGET: "10.7"
113-
TARBALL_ARCHIVE_SUFFIX: aarch64-darwin
106+
# Using 9.8.2 to work around
107+
# https://gitlab.haskell.org/ghc/ghc/-/issues/24050
108+
GHC_VERSION: 9.8.2
109+
TARBALL_ARCHIVE_SUFFIX: ${ARCH}-darwin
114110
TARBALL_EXT: tar.xz
115111
ADD_CABAL_ARGS: ""
116-
# Update periodically.
117-
BREW_VERSION: 4.0.5
118-
artifacts:
119-
expire_in: 2 week
120-
paths:
121-
- out/*
122-
cache:
123-
paths:
124-
- .brew
112+
script:
113+
- arch -${ARCHARCH} /bin/bash .gitlab/ci.sh
125114

126-
build-x86_64-windows:
115+
x86_64-windows:
127116
extends: .build
128117
script:
129118
- $env:CHERE_INVOKING = "yes"

.gitlab/ci.sh

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,26 @@ set -Eeuo pipefail
44

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

7-
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR/toolchain"
7+
if [[ "$(uname)" == "Linux" ]]; then
8+
export PATH="/opt/ghc/${GHC_VERSION}/bin:${PATH}"
9+
# Not all runners use ci-images, so ghcup is used.
10+
else
11+
. "$CI_PROJECT_DIR/.gitlab/ghcup.sh"
12+
fi
13+
814
export CABAL_DIR="$CI_PROJECT_DIR/cabal"
915

1016
case "$(uname)" in
1117
MSYS_*|MINGW*)
1218
export CABAL_DIR="$(cygpath -w "$CABAL_DIR")"
13-
GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin"
1419
EXE_EXT=".exe"
1520
;;
1621
*)
17-
GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin"
1822
EXE_EXT=""
1923
;;
2024
esac
2125

2226
mkdir -p "$CABAL_DIR"
23-
mkdir -p "$GHCUP_BINDIR"
24-
export PATH="$GHCUP_BINDIR:$PATH"
25-
26-
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
27-
export BOOTSTRAP_HASKELL_GHC_VERSION=$GHC_VERSION
28-
export BOOTSTRAP_HASKELL_CABAL_VERSION=$CABAL_INSTALL_VERSION
29-
export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes
30-
# We don't use stack, and it isn't available on i386-deb9
31-
export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes
32-
33-
# for some reason the subshell doesn't pick up the arm64 environment on darwin
34-
# and starts installing x86_64 GHC
35-
case "$(uname -s)" in
36-
"Darwin"|"darwin")
37-
case "$(/usr/bin/arch)" in
38-
aarch64|arm64|armv8l)
39-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -arm64 /bin/bash
40-
;;
41-
*)
42-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
43-
;;
44-
esac
45-
;;
46-
*)
47-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
48-
;;
49-
esac
5027

5128
# https://github.com/haskell/cabal/issues/7313#issuecomment-811851884
5229
# and
@@ -74,7 +51,6 @@ case "$(uname)" in
7451
esac
7552

7653
args=(
77-
-w "ghc-$GHC_VERSION"
7854
--disable-profiling
7955
--enable-executable-stripping
8056
--project-file=cabal.project.release

.gitlab/ghcup.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR/toolchain"
2+
3+
case "$(uname)" in
4+
MSYS_*|MINGW*)
5+
GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin"
6+
;;
7+
*)
8+
GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin"
9+
;;
10+
esac
11+
12+
mkdir -p "$GHCUP_BINDIR"
13+
export PATH="$GHCUP_BINDIR:$PATH"
14+
15+
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
16+
export BOOTSTRAP_HASKELL_GHC_VERSION=$GHC_VERSION
17+
export BOOTSTRAP_HASKELL_CABAL_VERSION=$CABAL_INSTALL_VERSION
18+
export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes
19+
# We don't use stack, and it isn't available on i386-deb9
20+
export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes
21+
22+
# for some reason the subshell doesn't pick up the arm64 environment on darwin
23+
# and starts installing x86_64 GHC
24+
case "$(uname -s)" in
25+
"Darwin"|"darwin")
26+
case "$(/usr/bin/arch)" in
27+
aarch64|arm64|armv8l)
28+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -arm64 /bin/bash
29+
;;
30+
*)
31+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
32+
;;
33+
esac
34+
;;
35+
*)
36+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
37+
;;
38+
esac

0 commit comments

Comments
 (0)