From 16327cf5c57d7c5d5d6d456e6082768d778628df Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 13 Oct 2023 14:09:49 -0700 Subject: [PATCH] Add custom environment for ARM Linux cross-compilation --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a26e5640..8edcce0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,6 +83,7 @@ jobs: - check_only: false - extra_test_args: '' - apt_packages: '' + - custom_env: {} - thing: stable target: x86_64-unknown-linux-gnu rust: stable @@ -136,12 +137,20 @@ jobs: os: ubuntu-latest apt_packages: gcc-arm-linux-gnueabi g++-arm-linux-gnueabi check_only: true + custom_env: + CC: arm-linux-gnueabi-gcc + CXX: arm-linux-gnueabi-g++ + CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER: arm-linux-gnueabi-g++ - thing: aarch64-linux target: aarch64-unknown-linux-gnu rust: stable os: ubuntu-latest apt_packages: crossbuild-essential-arm64 check_only: true + custom_env: + CC: aarch64-linux-gnu-gcc + CXX: aarch64-linux-gnu-g++ + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-g++ - thing: x86_64-mingw target: x86_64-pc-windows-gnu rust: stable @@ -187,10 +196,12 @@ jobs: - if: "!matrix.check_only" run: cargo test --target ${{ matrix.target }} ${{ matrix.extra_test_args }} name: Run tests + env: ${{ matrix.custom_env }} - if: matrix.check_only # We `build` because we want the linker to verify we are cross-compiling correctly. run: cargo build --target ${{ matrix.target }} --tests name: Build tests + env: ${{ matrix.custom_env }} - name: Test boring-sys cargo publish # Running `cargo publish --dry-run` tests two things: #