Skip to content

Commit 3b363c8

Browse files
committed
Merge branch 'alpine-aarch64-2'
2 parents 93dd3b9 + 7a39c3c commit 3b363c8

File tree

8 files changed

+141
-10
lines changed

8 files changed

+141
-10
lines changed

.github/scripts/build.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GHC="ghc-${GHC_VER}"
2121

2222
# build
2323
ecabal update
24-
build_with_cache --project-file=cabal.project.release -w "${GHC}" --enable-tests
24+
build_with_cache --project-file=cabal.project.release -w "${GHC}" --enable-tests "$@"
2525

2626
# set up artifacts
2727
mkdir -p out

.github/scripts/test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ if [ "${OS}" = "macOS" ] && [ "${ARCH}" = "ARM64" ] ; then
105105
elif [ "${OS}" = "FreeBSD" ] ; then
106106
# not enough space
107107
echo
108+
elif [ "${OS}" = "Linux" ] && [ "${ARCH}" = "ARM64" ] && [ "${DISTRO}" = "Alpine" ]; then
109+
# missing bindists
110+
echo
108111
else
109112
# test installing new ghc doesn't mess with currently set GHC
110113
# https://gitlab.haskell.org/haskell/ghcup-hs/issues/7

.github/workflows/cabal.project.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838
with:
3939
submodules: 'true'
4040

41+
- if: runner.os == 'Linux'
42+
name: Install prerequisites
43+
run: |
44+
sudo apt update
45+
sudo apt install -y libbz2-dev
46+
4147
- name: Run build
4248
run: |
4349
env

.github/workflows/docker.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ jobs:
110110
username: ${{ secrets.DOCKERHUB_USERNAME }}
111111
password: ${{ secrets.DOCKERHUB_TOKEN }}
112112

113+
- name: Build and push (Alpine)
114+
uses: docker/build-push-action@v3
115+
with:
116+
context: ./docker/arm64v8/alpine
117+
push: true
118+
tags: hasufell/arm64v8-alpine-haskell:3.20
119+
platforms: linux/arm64
120+
113121
- name: Build and push (debian buster)
114122
uses: docker/build-push-action@v3
115123
with:

.github/workflows/release.yaml

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
ARCH: 32
3737
- os: ubuntu-latest
3838
ARTIFACT: "x86_64-linux-ghcup"
39-
GHC_VER: 9.6.6
39+
GHC_VER: 9.8.4
4040
ARCH: 64
4141
steps:
4242
- name: Checkout code
@@ -98,10 +98,17 @@ jobs:
9898
ARTIFACT: "armv7-linux-ghcup"
9999
GHC_VER: 9.2.8
100100
ARCH: ARM
101+
DISTRO: Debian
101102
- os: [self-hosted, Linux, ARM64, maerwald]
102103
ARTIFACT: "aarch64-linux-ghcup"
103104
GHC_VER: 9.6.6
104105
ARCH: ARM64
106+
DISTRO: Debian
107+
- os: [self-hosted, Linux, ARM64, maerwald]
108+
ARTIFACT: "aarch64-linux-alpine-ghcup"
109+
GHC_VER: 9.8.4
110+
ARCH: ARM64
111+
DISTRO: Alpine
105112
steps:
106113
- name: git config
107114
run: |
@@ -122,13 +129,13 @@ jobs:
122129
ARTIFACT: ${{ matrix.ARTIFACT }}
123130
ARCH: ${{ matrix.ARCH }}
124131
GHC_VER: ${{ matrix.GHC_VER }}
125-
DISTRO: Ubuntu
132+
DISTRO: ${{ matrix.DISTRO }}
126133
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
127134
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
128135
S3_HOST: ${{ env.S3_HOST }}
129136
LD: ld.gold
130137

131-
- if: matrix.ARCH == 'ARM64'
138+
- if: matrix.ARCH == 'ARM64' && matrix.DISTRO == 'Debian'
132139
uses: docker://hasufell/arm64v8-debian-haskell:10
133140
name: Run build (aarch64 linux)
134141
with:
@@ -137,7 +144,21 @@ jobs:
137144
ARTIFACT: ${{ matrix.ARTIFACT }}
138145
ARCH: ${{ matrix.ARCH }}
139146
GHC_VER: ${{ matrix.GHC_VER }}
140-
DISTRO: Ubuntu
147+
DISTRO: ${{ matrix.DISTRO }}
148+
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
149+
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
150+
S3_HOST: ${{ env.S3_HOST }}
151+
152+
- if: matrix.ARCH == 'ARM64' && matrix.DISTRO == 'Alpine'
153+
uses: docker://hasufell/arm64v8-alpine-haskell:3.20
154+
name: Run build (aarch64 linux)
155+
with:
156+
args: sh -c ".github/scripts/build.sh '--ghc-options=-split-sections' '--enable-executable-static'"
157+
env:
158+
ARTIFACT: ${{ matrix.ARTIFACT }}
159+
ARCH: ${{ matrix.ARCH }}
160+
GHC_VER: ${{ matrix.GHC_VER }}
161+
DISTRO: ${{ matrix.DISTRO }}
141162
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
142163
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
143164
S3_HOST: ${{ env.S3_HOST }}
@@ -366,12 +387,17 @@ jobs:
366387
ARTIFACT: "armv7-linux-ghcup"
367388
GHC_VER: 9.2.8
368389
ARCH: ARM
369-
DISTRO: Ubuntu
390+
DISTRO: Debian
370391
- os: [self-hosted, Linux, ARM64, maerwald]
371392
ARTIFACT: "aarch64-linux-ghcup"
372393
GHC_VER: 9.6.6
373394
ARCH: ARM64
374-
DISTRO: Ubuntu
395+
DISTRO: Debian
396+
- os: [self-hosted, Linux, ARM64, maerwald]
397+
ARTIFACT: "aarch64-linux-alpine-ghcup"
398+
GHC_VER: 9.8.4
399+
ARCH: ARM64
400+
DISTRO: Alpine
375401

376402
steps:
377403
- name: Checkout code
@@ -393,10 +419,10 @@ jobs:
393419
ARTIFACT: ${{ matrix.ARTIFACT }}
394420
ARCH: ${{ matrix.ARCH }}
395421
GHC_VER: ${{ matrix.GHC_VER }}
396-
DISTRO: Ubuntu
422+
DISTRO: ${{ matrix.DISTRO }}
397423
LD: ld.gold
398424

399-
- if: matrix.ARCH == 'ARM64'
425+
- if: matrix.ARCH == 'ARM64' && matrix.DISTRO == 'Debian'
400426
uses: docker://hasufell/arm64v8-debian-haskell:10
401427
name: Run test (aarch64 linux)
402428
with:
@@ -407,6 +433,17 @@ jobs:
407433
GHC_VER: ${{ matrix.GHC_VER }}
408434
DISTRO: Ubuntu
409435

436+
- if: matrix.ARCH == 'ARM64' && matrix.DISTRO == 'Alpine'
437+
uses: docker://hasufell/arm64v8-alpine-haskell:3.20
438+
name: Run test (aarch64 alpine)
439+
with:
440+
args: sh .github/scripts/test.sh
441+
env:
442+
ARTIFACT: ${{ matrix.ARTIFACT }}
443+
ARCH: ${{ matrix.ARCH }}
444+
GHC_VER: ${{ matrix.GHC_VER }}
445+
DISTRO: Ubuntu
446+
410447
- if: failure()
411448
name: Upload artifact
412449
uses: actions/upload-artifact@v3

.github/workflows/stack.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ jobs:
2626
with:
2727
submodules: 'true'
2828

29+
- if: runner.os == 'Linux'
30+
name: Install prerequisites
31+
run: |
32+
sudo apt update
33+
sudo apt install -y libbz2-dev
34+
2935
- name: Run build
3036
run: |
3137
env

docker/arm64v8/alpine/Dockerfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
FROM alpine:3.20
2+
3+
ENV LANG C.UTF-8
4+
5+
RUN apk add --no-cache \
6+
curl \
7+
gcc \
8+
g++ \
9+
binutils \
10+
binutils-gold \
11+
coreutils \
12+
bsd-compat-headers \
13+
gmp-dev \
14+
ncurses-dev \
15+
libffi-dev \
16+
make \
17+
xz \
18+
tar \
19+
perl \
20+
bash \
21+
diffutils \
22+
git \
23+
gzip \
24+
gnupg && \
25+
apk add --no-cache \
26+
zlib \
27+
zlib-dev \
28+
zlib-static \
29+
bzip2 \
30+
bzip2-dev \
31+
bzip2-static \
32+
gmp \
33+
gmp-dev \
34+
openssl-dev \
35+
openssl-libs-static \
36+
xz \
37+
xz-dev \
38+
ncurses-static
39+
40+
ARG GHCUP_VERSION=0.1.30.0
41+
ARG GPG_KEY="7D1E8AFD1D4A16D71FADA2F2CCC85C0E40C06A8C FFEB7CE81E16A36B3E2DED6F2DE04D4E97DB64AD 88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4 EAF2A9A722C0C96F2B431CA511AAD8CEDEE0CAEF"
42+
43+
44+
# install ghcup
45+
RUN gpg --batch --keyserver keys.openpgp.org --recv-keys $GPG_KEY && \
46+
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/aarch64-linux-static-ghcup-$GHCUP_VERSION && \
47+
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/SHA256SUMS && \
48+
curl -sSfL -O https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/SHA256SUMS.sig && \
49+
gpg --verify SHA256SUMS.sig SHA256SUMS && \
50+
sha256sum -c --ignore-missing SHA256SUMS && \
51+
mv aarch64-linux-static-ghcup-$GHCUP_VERSION /usr/bin/ghcup && \
52+
chmod +x /usr/bin/ghcup && \
53+
rm -rf SHA256SUMS SHA256SUMS.sig ~/.gnupg/public-keys.d/pubring.db.lock
54+
55+
ARG GHC=9.8.4
56+
ARG CABAL_INSTALL=3.12.1.0
57+
58+
ENV GHCUP_CURL_OPTS="--silent"
59+
ENV NO_COLOR=1
60+
61+
# install haskell toolchain
62+
RUN ghcup config set gpg-setting GPGStrict && \
63+
ghcup --verbose install ghc --isolate=/usr --force ${GHC} && \
64+
ghcup --verbose install cabal --isolate=/usr/bin --force ${CABAL_INSTALL} && \
65+
find "/usr/lib/ghc-${GHC}/" \( -name "*_p.a" -o -name "*.p_hi" \) -type f -delete && \
66+
rm -rf "/usr/share/doc/ghc-${GHC}" && \
67+
rm -rf /tmp/ghcup* && \
68+
ghcup gc -p -s -c -t
69+
70+
ENV PATH /root/.cabal/bin:/root/.ghcup:/root/.local/bin:$PATH
71+

0 commit comments

Comments
 (0)