switch Linux builds to musl for static binaries

glibc-linked binaries fail on older distros (GLIBC_2.38 not found).
musl produces fully static binaries that work on any Linux.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Razvan Dimescu
2026-03-21 12:50:34 +02:00
parent d457ffc296
commit 14b035387b

View File

@@ -19,10 +19,10 @@ jobs:
- target: aarch64-apple-darwin - target: aarch64-apple-darwin
os: macos-latest os: macos-latest
name: numa-macos-aarch64 name: numa-macos-aarch64
- target: x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-musl
os: ubuntu-latest os: ubuntu-latest
name: numa-linux-x86_64 name: numa-linux-x86_64
- target: aarch64-unknown-linux-gnu - target: aarch64-unknown-linux-musl
os: ubuntu-latest os: ubuntu-latest
name: numa-linux-aarch64 name: numa-linux-aarch64
@@ -36,15 +36,22 @@ jobs:
targets: ${{ matrix.target }} targets: ${{ matrix.target }}
- name: Install cross-compilation tools - name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu' if: contains(matrix.target, 'linux')
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu sudo apt-get install -y musl-tools
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then
sudo apt-get install -y gcc-aarch64-linux-gnu musl-dev
# Install aarch64 musl cross-compiler
wget -q https://musl.cc/aarch64-linux-musl-cross.tgz
tar xzf aarch64-linux-musl-cross.tgz -C /opt
echo "/opt/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
fi
- name: Build - name: Build
run: cargo build --release --target ${{ matrix.target }} run: cargo build --release --target ${{ matrix.target }}
env: env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-musl-gcc
- name: Package - name: Package
run: | run: |