Skip to content

Commit cd93338

Browse files
authored
Merge pull request #6212 from commercialhaskell/fix6142
Fix #6142 Build statically-linked Linux/Aarch64 Stack
2 parents 459dd7e + 9370ba1 commit cd93338

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

.github/workflows/integration-tests.yml

+22-6
Original file line numberDiff line numberDiff line change
@@ -177,20 +177,36 @@ jobs:
177177
shell: bash
178178
run: |
179179
echo '::notice title=ARM64 skipped::To build ARM64, a self-hosted runner needs to be configured and the SELF_HOSTED_RUNNERS secret must contain arm64'
180-
181180
- name: Clone project
182181
if: needs.configuration.outputs.test-arm64 == 'true'
183182
uses: actions/checkout@v3
183+
- name: Install deps
184+
shell: bash
185+
run: |
186+
set -ex
184187
188+
# The release.hs script depends on digest, and digest requires
189+
# pkg-config. TO DO: Perhaps the self-hosted runner's software should
190+
# include pkg-config.
191+
sudo apt-get update
192+
sudo apt-get install -y pkg-config
193+
194+
# As of 19 August 2023, the self-hosted runner comes with Stack 2.11.1,
195+
# but it is not on the PATH. Logging the version for information.
196+
/usr/local/bin/stack --version
197+
198+
set +ex
185199
- name: Build bindist
186200
if: needs.configuration.outputs.test-arm64 == 'true'
187201
shell: bash
188202
run: |
189-
set -ex
190-
docker build . -f etc/dockerfiles/arm64.Dockerfile -t stack --build-arg USERID=$(id -u) --build-arg GROUPID=$(id -g)
191-
rm -rf _release
192-
mkdir -p _release
193-
docker run --rm -v $(pwd):/src -w /src stack bash -c "/home/stack/release build"
203+
# Stack's project-level configuration (stack.yaml) specifies the
204+
# multi-architecture (including Linux/Aarch64) Docker image published by
205+
# Oliver Benz (@benz0li, on GitHub). That image comes with Stack 2.11.1.
206+
# (Note that the online documentation for '--docker-stack-exe image'
207+
# specifies that the host Stack and image Stack must have the same
208+
# version number.)
209+
/usr/local/bin/stack etc/scripts/release.hs build --alpine --build-args --docker-stack-exe=image
194210
195211
- name: Upload bindist
196212
if: needs.configuration.outputs.test-arm64 == 'true'

ChangeLog.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release notes:
66

77
* Further to the release notes for Stack 2.3.1, the `-static` suffix has been
88
removed from the statically linked Linux/x86_64 binaries.
9+
* The binaries for Linux/Aarch64 are now statically linked.
910

1011
**Changes since v2.11.1:**
1112

etc/dockerfiles/arm64.Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# This Dockerfile was previously used to build dynamically-linked Stack for
2+
# Linux/Aarch64. It was used with the following step in the GitHub Actions CI:
3+
#
4+
# run: |
5+
# set -ex
6+
# docker build . -f etc/dockerfiles/arm64.Dockerfile -t stack --build-arg USERID=$(id -u) --build-arg GROUPID=$(id -g)
7+
# rm -rf _release
8+
# mkdir -p _release
9+
# docker run --rm -v $(pwd):/src -w /src stack bash -c "/home/stack/release build"
10+
#
11+
# However, after Stack 2.11.1, it was replaced with a step that makes use of
12+
# https://gitlab.com/benz0li/ghc-musl.
13+
#
14+
# ------------------------------------------------------------------------------
15+
#
116
# Stack is built with GHC 9.2.8. GHC 9.2.8 for Linux/AArch64 says it was made on
217
# a Debian 10 system and requires GMP 6.1. Debian 10 is codename 'buster' and
318
# includes libc6 (2.28-10+deb10u1).

0 commit comments

Comments
 (0)