From 87387c2f386a8ad33336aa08c28e3df5e9cc1428 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Fri, 17 Jan 2025 17:32:21 -0500 Subject: [PATCH 1/5] Run `test-fast` job (also) on Linux arm64 preview runner https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/ --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae35ff33c71..527487e1d6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,6 +135,7 @@ jobs: - windows-latest - macos-latest - ubuntu-latest + - ubuntu-24.04-arm runs-on: ${{ matrix.os }} From cbe37934af3795931653e42394b2152a0710bbfb Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sat, 18 Jan 2025 04:58:24 -0500 Subject: [PATCH 2/5] Use the ARM runner for some 32-bit tests This turns the `test-32bit` job into a matrix job definition with two jobs: the i386 job, which already existed, and a new ARMv7 job, which is able to run (still without emulation) in a container on the new ARM64 runner. As written, this is not expected to work, and is even expected to break the old job, because I've commented out the code that installs libraries for the 64-bit host architecture inside the container to allow the 64-bit Node.js on the host to run in the container for script steps. This is just to make sure that is still needed, before attempting to generalize it to cover both platforms. --- .github/workflows/ci.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 527487e1d6d..abd8c551113 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -199,9 +199,21 @@ jobs: etc/test-fixtures-windows-expected-failures-see-issue-1358.txt actual-failures.txt test-32bit: - runs-on: ubuntu-latest + strategy: + matrix: + container-arch: [ i386, arm32v7 ] + include: + - container-arch: i386 + runner-os: ubuntu-latest + toolchain: stable-i686-unknown-linux-gnu + - container-arch: arm32v7 + runner-os: ubuntu-24.04-arm + toolchain: stable-armv7-unknown-linux-gnueabihf + fail-fast: false # FIXME: Probably remove this. + + runs-on: ${{ matrix.runner-os }} - container: i386/debian:stable-slim + container: ${{ matrix.container-arch }}/debian:stable-slim steps: - name: Prerequisites @@ -214,17 +226,18 @@ jobs: git jq libssl-dev - libstdc++6:amd64 # To support external 64-bit Node.js for actions. + # libstdc++6:amd64 # To support external 64-bit Node.js for actions. pkgconf ) - dpkg --add-architecture amd64 + # dpkg --add-architecture amd64 apt-get update apt-get install --no-install-recommends -y -- "${prerequisites[@]}" shell: bash - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable-i686-unknown-linux-gnu # Otherwise it may misdetect based on the amd64 kernel. + # Avoid possible misdetection based on the 64-bit running kernel. + toolchain: ${{ matrix.toolchain }} - uses: Swatinem/rust-cache@v2 - uses: taiki-e/install-action@v2 with: @@ -260,8 +273,9 @@ jobs: run: cross check -p gix --target ${{ matrix.target }} - name: Test (unit) run: | - # Run some high-level unit tests that exercise various pure Rust code to ease building test binaries. - # We would prefer `-p gix`. But with `cross`, fixture scripts try to run amd64 `git` as an armv7 binary. + # Run some high-level unit tests that exercise various pure Rust code to ease building + # test binaries. We would prefer `-p gix`. But with `cross`, fixture scripts try to run + # the host `git` as an armv7 binary. cross test -p gix-hashtable --target ${{ matrix.target }} lint: From fbc27b56eca40a4cf97e32fb271cc88e7449d25c Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sat, 18 Jan 2025 05:11:48 -0500 Subject: [PATCH 3/5] Install 64-bit libstdc++ in both 32-bit containers This is needed so script steps can run Node.js, which is the 64-bit Node.js on the host. This appears not just to still be the case for x86, but also for ARM when using containers on the new ARM runners. --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abd8c551113..c94ac387d4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -204,9 +204,11 @@ jobs: container-arch: [ i386, arm32v7 ] include: - container-arch: i386 + runner-arch: amd64 runner-os: ubuntu-latest toolchain: stable-i686-unknown-linux-gnu - container-arch: arm32v7 + runner-arch: arm64 runner-os: ubuntu-24.04-arm toolchain: stable-armv7-unknown-linux-gnueabihf fail-fast: false # FIXME: Probably remove this. @@ -226,10 +228,10 @@ jobs: git jq libssl-dev - # libstdc++6:amd64 # To support external 64-bit Node.js for actions. + libstdc++6:${{ matrix.runner-arch }} # To support external 64-bit Node.js for actions. pkgconf ) - # dpkg --add-architecture amd64 + dpkg --add-architecture ${{ matrix.runner-arch }} apt-get update apt-get install --no-install-recommends -y -- "${prerequisites[@]}" shell: bash From c3d4cff002a56ab91d6a2b9aae1ca03c7131def3 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sat, 18 Jan 2025 05:28:39 -0500 Subject: [PATCH 4/5] Remove the `test-32bit-cross` job It was not able to test as much as was desired, and there is now a job-level container based way that does a full 32-but ARMv7 test (facilitated by the new ARM64 runners, which are also able to execute ARMv7 binaries without emulation). The new ARM jobs added in the last couple of commits, consisting of a 64-bit job in `test-fast` and a 32-bit job in `test-32bit`, increase the total time and resources required to run CI checks. Removing `test-32bit-cross` only slightly counteracts that. But it is also less needed now. --- .github/workflows/ci.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c94ac387d4e..570cfaad7f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,35 +251,6 @@ jobs: GIX_TEST_IGNORE_ARCHIVES: '1' run: cargo nextest run --workspace --no-fail-fast - test-32bit-cross: - runs-on: ubuntu-latest - - strategy: - matrix: - target: [ armv7-linux-androideabi ] - - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - - name: Install Rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - targets: ${{ matrix.target }} - - name: Install cross - uses: taiki-e/install-action@v2 - with: - tool: cross - - name: check - run: cross check -p gix --target ${{ matrix.target }} - - name: Test (unit) - run: | - # Run some high-level unit tests that exercise various pure Rust code to ease building - # test binaries. We would prefer `-p gix`. But with `cross`, fixture scripts try to run - # the host `git` as an armv7 binary. - cross test -p gix-hashtable --target ${{ matrix.target }} - lint: runs-on: ubuntu-latest @@ -455,7 +426,6 @@ jobs: - test-journey - test-fast - test-32bit - - test-32bit-cross - lint - cargo-deny - check-packetline From c7f501315cbe1755cb37a66cc3dd39ea7ef095c3 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sat, 18 Jan 2025 05:57:24 -0500 Subject: [PATCH 5/5] Let either `test-32bit` cancel the other on failure Neither is expected to fail, so this is analogous to most of the other matrix jobs, such as `test-fast`, with no more of a reason than there to use `fail-fast: true`. So this removes that. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 570cfaad7f9..36511391c14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -211,7 +211,6 @@ jobs: runner-arch: arm64 runner-os: ubuntu-24.04-arm toolchain: stable-armv7-unknown-linux-gnueabihf - fail-fast: false # FIXME: Probably remove this. runs-on: ${{ matrix.runner-os }}