Skip to content

Commit

Permalink
Merge pull request #6212 from commercialhaskell/fix6142
Browse files Browse the repository at this point in the history
Fix #6142 Build statically-linked Linux/Aarch64 Stack
  • Loading branch information
mpilgrem authored Aug 19, 2023
2 parents 459dd7e + 9370ba1 commit cd93338
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,36 @@ jobs:
shell: bash
run: |
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'
- name: Clone project
if: needs.configuration.outputs.test-arm64 == 'true'
uses: actions/checkout@v3
- name: Install deps
shell: bash
run: |
set -ex
# The release.hs script depends on digest, and digest requires
# pkg-config. TO DO: Perhaps the self-hosted runner's software should
# include pkg-config.
sudo apt-get update
sudo apt-get install -y pkg-config
# As of 19 August 2023, the self-hosted runner comes with Stack 2.11.1,
# but it is not on the PATH. Logging the version for information.
/usr/local/bin/stack --version
set +ex
- name: Build bindist
if: needs.configuration.outputs.test-arm64 == 'true'
shell: bash
run: |
set -ex
docker build . -f etc/dockerfiles/arm64.Dockerfile -t stack --build-arg USERID=$(id -u) --build-arg GROUPID=$(id -g)
rm -rf _release
mkdir -p _release
docker run --rm -v $(pwd):/src -w /src stack bash -c "/home/stack/release build"
# Stack's project-level configuration (stack.yaml) specifies the
# multi-architecture (including Linux/Aarch64) Docker image published by
# Oliver Benz (@benz0li, on GitHub). That image comes with Stack 2.11.1.
# (Note that the online documentation for '--docker-stack-exe image'
# specifies that the host Stack and image Stack must have the same
# version number.)
/usr/local/bin/stack etc/scripts/release.hs build --alpine --build-args --docker-stack-exe=image
- name: Upload bindist
if: needs.configuration.outputs.test-arm64 == 'true'
Expand Down
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release notes:

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

**Changes since v2.11.1:**

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

0 comments on commit cd93338

Please sign in to comment.