Skip to content

Commit c83a655

Browse files
committed
chore: add musl tools to musl runners
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
1 parent c5b2667 commit c83a655

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/release-ffi.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,30 @@ jobs:
7777
# subsequent releases of the same target.
7878
key: ${{ matrix.target }}
7979

80+
- name: Install musl toolchain
81+
# ring (via jsonwebtoken/rustls/quinn) compiles C + asm through
82+
# cc-rs, which for a *-unknown-linux-musl target shells out to
83+
# <arch>-linux-musl-gcc. The runners ship only the glibc gcc, so
84+
# we install musl-gcc here. The matrix runs each musl target on
85+
# its native-arch runner, so musl-gcc targets the host arch and
86+
# the CC_/LINKER env vars below redirect cc-rs and the linker to
87+
# it. Scoped to the musl legs; gnu/darwin use their default cc.
88+
if: contains(matrix.target, 'musl')
89+
run: sudo apt-get update && sudo apt-get install -y musl-tools musl-dev
90+
8091
- name: Build artifact
8192
env:
8293
TARGET: ${{ matrix.target }}
8394
# VERSION drops the leading "refs/tags/" so the tarball
8495
# name matches the tag verbatim.
8596
VERSION: ${{ github.ref_name }}
8697
DIST_DIR: dist
98+
# Point cc-rs and the linker at musl-gcc for the musl targets.
99+
# No-ops for gnu/darwin (those triples don't match these keys).
100+
CC_x86_64_unknown_linux_musl: musl-gcc
101+
CC_aarch64_unknown_linux_musl: musl-gcc
102+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
103+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
87104
run: bash scripts/release/build-artifact.sh
88105

89106
- name: Upload tarball + sha256

0 commit comments

Comments
 (0)