From b1411588686ad8f483e89c91362df8c9b6f0a891 Mon Sep 17 00:00:00 2001 From: Gulshan Yadav Date: Mon, 2 Feb 2026 03:32:14 +0530 Subject: [PATCH] fix: use cross tool for ARM64 Linux cross-compilation - Install and use cross-rs/cross for ARM64 builds - Cross provides Docker containers with proper ARM64 sysroots - Fixes OpenSSL not found error in cross-compilation --- .github/workflows/release.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69dc1e2..1808d58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,11 +53,9 @@ jobs: with: targets: ${{ matrix.target }} - - name: Install cross-compilation tools + - name: Install cross tool if: matrix.cross - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + run: cargo install cross --git https://github.com/cross-rs/cross - name: Install system dependencies (Linux) if: runner.os == 'Linux' && !matrix.cross @@ -85,18 +83,17 @@ jobs: restore-keys: | ${{ runner.os }}-${{ matrix.target }}-cargo-target-release- - - name: Build release binaries (Unix) - if: runner.os != 'Windows' + - name: Build release binaries (Unix with cross) + if: runner.os != 'Windows' && matrix.cross env: TARGET: ${{ matrix.target }} - CROSS: ${{ matrix.cross }} - run: | - if [[ "$CROSS" == "true" ]]; then - export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc - export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc - export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ - fi - cargo build --release --workspace --target "$TARGET" + run: cross build --release --workspace --target "$TARGET" + + - name: Build release binaries (Unix native) + if: runner.os != 'Windows' && !matrix.cross + env: + TARGET: ${{ matrix.target }} + run: cargo build --release --workspace --target "$TARGET" - name: Build release binaries (Windows) if: runner.os == 'Windows'