Skip to content

Commit ac6398e

Browse files
authored
fix(ci): use native musl toolchain for arm64 static builds (#115)
The arm64-musl build runs on a native ARM64 runner, so it doesn't need cross-compilation. The previous setup tried to download an x86_64 cross-compiler which can't run on ARM64. This changes the arm64-musl build to use the native musl-gcc toolchain instead of a cross-compiler.
1 parent df805a7 commit ac6398e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,12 @@ jobs:
172172
- name: Install musl toolchain (aarch64 static)
173173
if: matrix.target == 'aarch64-unknown-linux-musl'
174174
run: |
175-
# For cross-compiling to aarch64-musl, we need the cross toolchain
176-
sudo apt-get install -y musl-tools musl-dev gcc-aarch64-linux-gnu
177-
# Install aarch64-linux-musl-gcc cross compiler
178-
wget -q https://musl.cc/aarch64-linux-musl-cross.tgz
179-
tar xzf aarch64-linux-musl-cross.tgz
180-
sudo mv aarch64-linux-musl-cross /opt/
181-
echo "/opt/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
175+
# Since we're running on native ARM64, we don't need cross-compilation
176+
# Just install the musl toolchain natively
177+
sudo apt-get install -y musl-tools musl-dev
178+
# Verify musl-gcc is available
179+
which musl-gcc
180+
musl-gcc --version
182181
183182
# Windows ARM64 requires clang from Visual Studio for building the ring crate
184183
# See: https://github.com/briansmith/ring/blob/main/BUILDING.md
@@ -259,13 +258,14 @@ jobs:
259258
if: matrix.target == 'aarch64-unknown-linux-musl'
260259
run: |
261260
# Build without audio feature (rodio/alsa) for musl - uses terminal bell fallback
261+
# Using native musl-gcc since we're on an ARM64 runner building for ARM64 target
262262
cargo +nightly build --release --target ${{ matrix.target }} -p cortex-cli --no-default-features --features cortex-tui
263263
env:
264264
RUSTFLAGS: "-Zthreads=32 -C target-feature=+crt-static"
265265
CARGO_PROFILE_RELEASE_LTO: thin
266-
CC_aarch64_unknown_linux_musl: aarch64-linux-musl-gcc
267-
AR_aarch64_unknown_linux_musl: aarch64-linux-musl-ar
268-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-musl-gcc
266+
CC_aarch64_unknown_linux_musl: musl-gcc
267+
AR_aarch64_unknown_linux_musl: ar
268+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: musl-gcc
269269

270270
# =========================================================================
271271
# Verify static binary (for musl builds)

0 commit comments

Comments
 (0)