Skip to content

Commit

Permalink
chore(ci): add aarch64 linux runner
Browse files Browse the repository at this point in the history
Linux arm64 hosted runners is in public preview.
Enable and see if is is something we can have now.

setting `target.linker` is required for cross-compilation
on ARM64, so disable cross compilation tests for it.

https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/
  • Loading branch information
weihanglo committed Jan 24, 2025
1 parent 531215f commit 7ce26d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ jobs:
os: ubuntu-latest
rust: nightly
other: i686-unknown-linux-gnu
- name: Linux aarch64 stable
os: ubuntu-24.04-arm
rust: stable
other: TODO # cross-compile tests are disabled, this shouldn't matter.
- name: Linux aarch64 nightly
os: ubuntu-24.04-arm
rust: nightly
other: TODO # cross-compile tests are disabled, this shouldn't matter.
- name: macOS aarch64 stable
os: macos-14
rust: stable
Expand Down Expand Up @@ -161,6 +169,7 @@ jobs:
- run: rustup update --no-self-update stable
- run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: rustup target add ${{ matrix.other }}
if: matrix.os != 'ubuntu-24.04-arm'
- run: rustup target add wasm32-unknown-unknown
- run: rustup target add aarch64-unknown-none # need this for build-std mock tests
if: startsWith(matrix.rust, 'nightly')
Expand Down
6 changes: 6 additions & 0 deletions crates/cargo-test-support/src/cross_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ pub fn disabled() -> bool {
_ => {}
}

// It requires setting `target.linker` for cross-compilation to work on aarch64,
// so not going to bother now.
if cfg!(all(target_arch = "aarch64", target_os = "linux")) {
return true;
}

// Cross tests are only tested to work on macos, linux, and MSVC windows.
if !(cfg!(target_os = "macos") || cfg!(target_os = "linux") || cfg!(target_env = "msvc")) {
return true;
Expand Down

0 comments on commit 7ce26d4

Please sign in to comment.