From 02ea1b0f6296c3f1caba665f6f9b53e471c26019 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Sat, 27 Apr 2024 11:18:24 -0300 Subject: [PATCH 1/2] Refactor PR CI Upstream tooling has several breaking changes that limit our ability to cross compile on CI. - MIPS downgraged to Tier 3 and not providing rust-std pre-compilation - MIPS having `-lunwind` errors on nightly when running `-Z build-std` - Stable cross for Android lacking `-lunwind` on the container This commit separate the problematic pipelines into their own workflow, so it does not interrupt the build matrix of stable cross compilation tools. Furthermore, to alleviate the MIPS Tier 3 downgraged, we now pin the MIPS pipeline to Rust 1.71, which still had MIPS as Tier 2. --- .github/workflows/android.yml | 30 +++++++++++++++++++++++++++++ .github/workflows/cross_compile.yml | 2 -- .github/workflows/mips.yml | 28 +++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/android.yml create mode 100644 .github/workflows/mips.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..4958b5b --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,30 @@ +# We could use `@actions-rs/cargo` Action ability to automatically install `cross` tool +# in order to compile our application for some unusual targets. + +# Separated as another pipeline to avoid errors cancelling other targets until the cross issue is solved +# Ref: https://github.com/bltavares/multicast-socket/issues/18 + +on: [push, pull_request] + +name: Cross-compile android + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + target: + - aarch64-linux-android + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + override: true + - uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target=${{ matrix.target }} --examples \ No newline at end of file diff --git a/.github/workflows/cross_compile.yml b/.github/workflows/cross_compile.yml index d686f6e..5476662 100644 --- a/.github/workflows/cross_compile.yml +++ b/.github/workflows/cross_compile.yml @@ -13,8 +13,6 @@ jobs: matrix: target: - armv7-unknown-linux-gnueabihf - - aarch64-linux-android - - mips-unknown-linux-musl - x86_64-unknown-linux-musl - aarch64-unknown-linux-gnu steps: diff --git a/.github/workflows/mips.yml b/.github/workflows/mips.yml new file mode 100644 index 0000000..228c2f4 --- /dev/null +++ b/.github/workflows/mips.yml @@ -0,0 +1,28 @@ +# Since Rust 1.72+ MIPS is a Tier 3 platform, and there are many errors on the latest nightly to use -Z build-std. +# So we pin it to 1.71 to produce valid targets +# Ref: https://github.com/rust-lang/compiler-team/issues/648 + +on: [push, pull_request] + +name: Cross-compile MIPS + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + target: + - mips-unknown-linux-musl + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.71 + target: ${{ matrix.target }} + override: true + - uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target=${{ matrix.target }} --examples \ No newline at end of file From 8b388b03bcbda04c27b6497e6891a9cb6f011665 Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Sat, 27 Apr 2024 11:30:03 -0300 Subject: [PATCH 2/2] Pin android build to a suposedly working image --- .github/workflows/android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 4958b5b..284460d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: 1.67 target: ${{ matrix.target }} override: true - uses: actions-rs/cargo@v1