Skip to content

Commit 20bfed0

Browse files
committed
fix(ci): add cross-compilation toolchain for aarch64-linux-gnu
Install gcc-aarch64-linux-gnu and set CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER to fix the release workflow failing with "failed to find tool aarch64-linux-gnu-gcc" when cross-compiling vite_global_cli from x86_64 to aarch64.
1 parent c5f4e92 commit 20bfed0

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/actions/build-upstream/action.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,22 @@ runs:
8282
env:
8383
DEBUG: napi:*
8484

85-
- name: Build Rust CLI binary
86-
if: steps.cache-restore.outputs.cache-hit != 'true'
85+
- name: Install aarch64 cross-compilation toolchain
86+
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'aarch64-unknown-linux-gnu'
87+
shell: bash
88+
run: |
89+
sudo apt-get update
90+
sudo apt-get install -y gcc-aarch64-linux-gnu
91+
92+
- name: Build Rust CLI binary (aarch64-linux)
93+
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'aarch64-unknown-linux-gnu'
94+
shell: bash
95+
run: cargo build --release --target ${{ inputs.target }} -p vite_global_cli
96+
env:
97+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
98+
99+
- name: Build Rust CLI binary (other targets)
100+
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target != 'aarch64-unknown-linux-gnu'
87101
shell: bash
88102
run: cargo build --release --target ${{ inputs.target }} -p vite_global_cli
89103

0 commit comments

Comments
 (0)