Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit a55dee4

Browse files
committed
linker issue github action (1)
1 parent 2f000f5 commit a55dee4

1 file changed

Lines changed: 26 additions & 17 deletions

File tree

.github/workflows/release.yaml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,31 +67,40 @@ jobs:
6767
if: matrix.os == 'ubuntu-latest'
6868
run: |
6969
sudo apt-get update
70-
sudo apt-get install -y musl-tools musl-dev gcc-aarch64-linux-gnu
71-
70+
sudo apt-get install -y musl-tools musl-dev
71+
7272
# Install required Rust targets
7373
if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-musl" ]]; then
7474
rustup target add aarch64-unknown-linux-musl
7575
fi
7676
if [[ "${{ matrix.target }}" == "x86_64-unknown-linux-musl" ]]; then
7777
rustup target add x86_64-unknown-linux-musl
7878
fi
79+
- name: Setup aarch64 MUSL cross toolchain
80+
if: matrix.os == 'ubuntu-latest' && matrix.target == 'aarch64-unknown-linux-musl'
81+
uses: taiki-e/setup-cross-toolchain@v1
82+
with:
83+
target: aarch64-unknown-linux-musl
84+
85+
- name: Build release
86+
env:
87+
CC: ${{ matrix.os == 'macos-latest' && 'clang' || '' }}
88+
CXX: ${{ matrix.os == 'macos-latest' && 'clang++' || '' }}
89+
MACOSX_DEPLOYMENT_TARGET: '10.12'
90+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: ${{ matrix.target == 'aarch64-unknown-linux-musl' && 'aarch64-linux-musl-gcc' || '' }}
91+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_AR: ${{ matrix.target == 'aarch64-unknown-linux-musl' && 'aarch64-linux-musl-ar' || '' }}
92+
CC_aarch64_unknown_linux_musl: ${{ matrix.target == 'aarch64-unknown-linux-musl' && 'aarch64-linux-musl-gcc' || '' }}
93+
run: |
94+
if [[ "${{ matrix.target }}" == "aarch64-apple-darwin" ]]; then
95+
export RUSTFLAGS="-C target-feature=+crt-static"
96+
fi
97+
98+
cargo build --release --target=${{ matrix.target }} --verbose
99+
if [ ! -f "target/${{ matrix.target }}/release/zinit" ]; then
100+
echo "::error::Binary not found at target/${{ matrix.target }}/release/zinit"
101+
exit 1
102+
fi
79103
80-
- name: Build release
81-
env:
82-
CC: ${{ (matrix.target == 'aarch64-unknown-linux-musl' && 'aarch64-linux-gnu-gcc') || (matrix.os == 'macos-latest' && 'clang') || '' }}
83-
CXX: ${{ (matrix.target == 'aarch64-unknown-linux-musl' && 'aarch64-linux-gnu-g++') || (matrix.os == 'macos-latest' && 'clang++') || '' }}
84-
MACOSX_DEPLOYMENT_TARGET: '10.12'
85-
run: |
86-
if [[ "${{ matrix.target }}" == "aarch64-apple-darwin" ]]; then
87-
export RUSTFLAGS="-C target-feature=+crt-static"
88-
fi
89-
90-
cargo build --release --target=${{ matrix.target }} --verbose
91-
if [ ! -f "target/${{ matrix.target }}/release/zinit" ]; then
92-
echo "::error::Binary not found at target/${{ matrix.target }}/release/zinit"
93-
exit 1
94-
fi
95104
96105
- name: Strip binary (Linux)
97106
if: matrix.os == 'ubuntu-latest'

0 commit comments

Comments
 (0)