fix: arm64 linux cross-compilation — add multiarch and pkg-config env vars
Some checks failed
Auto Tag / auto-tag (push) Successful in 3s
Release / build-linux-arm64 (push) Failing after 1m8s
Test / rust-fmt-check (push) Successful in 1m8s
Release / build-macos-arm64 (push) Successful in 4m27s
Test / rust-clippy (push) Successful in 7m15s
Test / rust-tests (push) Successful in 8m4s
Test / frontend-typecheck (push) Successful in 1m29s
Test / frontend-tests (push) Successful in 1m18s
Release / build-linux-amd64 (push) Successful in 16m23s
Release / build-windows-amd64 (push) Successful in 13m2s

The linux-arm64 runner runs an x86_64 Docker container so cross-compilation
requires the ARM64 sysroot via dpkg --add-architecture arm64, gcc-aarch64-linux-gnu,
and arm64 variants of all system libraries. PKG_CONFIG env vars point to the
aarch64 library paths so Tauri can find webkit/gtk/etc at compile time.
This commit is contained in:
Shaun Arman 2026-03-31 11:52:10 -05:00
parent 5b37bd3435
commit d489338bc4

View File

@ -158,13 +158,21 @@ jobs:
git checkout FETCH_HEAD git checkout FETCH_HEAD
- name: Install dependencies - name: Install dependencies
run: | run: |
# Enable arm64 multiarch so apt can install aarch64 libraries for cross-compilation
dpkg --add-architecture arm64
apt-get update -qq && apt-get install -y -qq \ apt-get update -qq && apt-get install -y -qq \
libwebkit2gtk-4.1-dev libssl-dev libgtk-3-dev \ gcc-aarch64-linux-gnu \
libayatana-appindicator3-dev librsvg2-dev patchelf \ libwebkit2gtk-4.1-dev:arm64 libssl-dev:arm64 libgtk-3-dev:arm64 \
libayatana-appindicator3-dev:arm64 librsvg2-dev:arm64 patchelf \
pkg-config curl perl pkg-config curl perl
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs apt-get install -y nodejs
- name: Build - name: Build
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
PKG_CONFIG_SYSROOT_DIR: /
PKG_CONFIG_LIBDIR: /usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig
PKG_CONFIG_ALLOW_CROSS: "1"
run: | run: |
npm ci --legacy-peer-deps npm ci --legacy-peer-deps
rustup target add aarch64-unknown-linux-gnu rustup target add aarch64-unknown-linux-gnu