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
This commit is contained in:
parent
7e573c95c0
commit
b141158868
1 changed files with 11 additions and 14 deletions
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
|
|
@ -53,11 +53,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
|
|
||||||
- name: Install cross-compilation tools
|
- name: Install cross tool
|
||||||
if: matrix.cross
|
if: matrix.cross
|
||||||
run: |
|
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
|
||||||
|
|
||||||
- name: Install system dependencies (Linux)
|
- name: Install system dependencies (Linux)
|
||||||
if: runner.os == 'Linux' && !matrix.cross
|
if: runner.os == 'Linux' && !matrix.cross
|
||||||
|
|
@ -85,18 +83,17 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-${{ matrix.target }}-cargo-target-release-
|
${{ runner.os }}-${{ matrix.target }}-cargo-target-release-
|
||||||
|
|
||||||
- name: Build release binaries (Unix)
|
- name: Build release binaries (Unix with cross)
|
||||||
if: runner.os != 'Windows'
|
if: runner.os != 'Windows' && matrix.cross
|
||||||
env:
|
env:
|
||||||
TARGET: ${{ matrix.target }}
|
TARGET: ${{ matrix.target }}
|
||||||
CROSS: ${{ matrix.cross }}
|
run: cross build --release --workspace --target "$TARGET"
|
||||||
run: |
|
|
||||||
if [[ "$CROSS" == "true" ]]; then
|
- name: Build release binaries (Unix native)
|
||||||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
|
if: runner.os != 'Windows' && !matrix.cross
|
||||||
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
|
env:
|
||||||
export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
|
TARGET: ${{ matrix.target }}
|
||||||
fi
|
run: cargo build --release --workspace --target "$TARGET"
|
||||||
cargo build --release --workspace --target "$TARGET"
|
|
||||||
|
|
||||||
- name: Build release binaries (Windows)
|
- name: Build release binaries (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue