Skip to content

Commit a471076

Browse files
authored
Merge pull request #4424 from RalfJung/aarch64-linux-ci
also test on arm-64 linux hosts
2 parents d69268d + 0f90ef2 commit a471076

File tree

3 files changed

+45
-21
lines changed

3 files changed

+45
-21
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,55 @@ defaults:
1313
shell: bash
1414

1515
jobs:
16-
build:
16+
test:
17+
name: build and test on ${{ matrix.host_target }}
1718
strategy:
1819
fail-fast: false
1920
matrix:
2021
include:
21-
- os: ubuntu-latest
22-
host_target: x86_64-unknown-linux-gnu
23-
- os: macos-14
24-
host_target: aarch64-apple-darwin
25-
- os: windows-latest
26-
host_target: i686-pc-windows-msvc
22+
- host_target: x86_64-unknown-linux-gnu
23+
os: ubuntu-latest
24+
# Needs a libffi patch: <https://github.com/libffi-rs/libffi-rs/pull/160>
25+
# - host_target: i686-unknown-linux-gnu
26+
# os: ubuntu-latest
27+
- host_target: aarch64-unknown-linux-gnu
28+
os: ubuntu-24.04-arm
29+
# Disabled due to <https://github.com/rust-lang/rust/issues/143184>.
30+
# - host_target: armv7-unknown-linux-gnueabihf
31+
# os: ubuntu-24.04-arm
32+
- host_target: aarch64-apple-darwin
33+
os: macos-latest
34+
- host_target: i686-pc-windows-msvc
35+
os: windows-latest
2736
runs-on: ${{ matrix.os }}
2837
env:
2938
HOST_TARGET: ${{ matrix.host_target }}
3039
steps:
3140
- uses: actions/checkout@v4
41+
- name: Install multilib dependencies
42+
if: ${{ matrix.host_target == 'i686-unknown-linux-gnu' }}
43+
run: |
44+
sudo dpkg --add-architecture i386
45+
sudo apt update
46+
sudo apt install gcc-multilib zlib1g-dev:i386 libffi-dev:i386
47+
- name: Install multilib dependencies
48+
if: ${{ matrix.host_target == 'armv7-unknown-linux-gnueabihf' }}
49+
run: |
50+
sudo dpkg --add-architecture armhf
51+
sudo apt update
52+
sudo apt install gcc-arm-linux-gnueabihf zlib1g-dev:armhf libffi-dev:armhf
3253
- uses: ./.github/workflows/setup
3354
with:
3455
toolchain_flags: "--host ${{ matrix.host_target }}"
3556

36-
# The `style` job only runs on Linux; this makes sure the Windows-host-specific
57+
- name: Test Miri
58+
run: ./ci/ci.sh
59+
60+
# The `style` job only runs on Linux; this makes sure the host-specific
3761
# code is also covered by clippy.
3862
- name: Check clippy
39-
if: ${{ matrix.os == 'windows-latest' }}
4063
run: ./miri clippy -- -D warnings
4164

42-
- name: Test Miri
43-
run: ./ci/ci.sh
44-
4565
style:
4666
name: style checks
4767
runs-on: ubuntu-latest
@@ -73,7 +93,7 @@ jobs:
7393
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
7494
# And they should be added below in `cron-fail-notify` as well.
7595
conclusion:
76-
needs: [build, style, coverage]
96+
needs: [test, style, coverage]
7797
# We need to ensure this job does *not* get skipped if its dependencies fail,
7898
# because a skipped job is considered a success by GitHub. So we have to
7999
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
@@ -135,7 +155,7 @@ jobs:
135155
cron-fail-notify:
136156
name: cronjob failure notification
137157
runs-on: ubuntu-latest
138-
needs: [build, style, coverage]
158+
needs: [test, style, coverage]
139159
if: ${{ github.event_name == 'schedule' && failure() }}
140160
steps:
141161
# Send a Zulip notification

.github/workflows/setup/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: "Miri CI setup"
22
description: "Sets up Miri CI"
33
inputs:
44
toolchain_flags:
5+
description: extra flags to pass to rustup-toolchain-install-master
56
required: false
67
default: ''
78
runs:
@@ -31,8 +32,9 @@ runs:
3132
~/.cargo/bin
3233
~/.cargo/.crates.toml
3334
~/.cargo/.crates2.json
34-
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock', '.github/workflows/**/*.yml') }}
35-
restore-keys: cargo-${{ runner.os }}
35+
# Bump the version when something here changes that needs a cache reset.
36+
key: cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }}-v1
37+
restore-keys: cargo-${{ runner.os }}-${{ runner.arch }}
3638

3739
- name: Install rustup-toolchain-install-master
3840
if: steps.cache.outputs.cache-hit != 'true'

ci/ci.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,16 @@ case $HOST_TARGET in
143143
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
144144
# Extra tier 1
145145
MANY_SEEDS=64 TEST_TARGET=i686-unknown-linux-gnu run_tests
146-
MANY_SEEDS=64 TEST_TARGET=aarch64-unknown-linux-gnu run_tests
147146
MANY_SEEDS=64 TEST_TARGET=x86_64-apple-darwin run_tests
148147
MANY_SEEDS=64 TEST_TARGET=x86_64-pc-windows-gnu run_tests
148+
;;
149+
aarch64-unknown-linux-gnu)
150+
# Host
151+
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
149152
# Extra tier 1 candidate
150153
MANY_SEEDS=64 TEST_TARGET=aarch64-pc-windows-msvc run_tests
154+
# Custom target JSON file
155+
TEST_TARGET=tests/x86_64-unknown-kernel.json MIRI_NO_STD=1 run_tests_minimal no_std
151156
;;
152157
aarch64-apple-darwin)
153158
# Host
@@ -172,13 +177,10 @@ case $HOST_TARGET in
172177
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
173178
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
174179
TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std
175-
# Custom target JSON file
176-
TEST_TARGET=tests/x86_64-unknown-kernel.json MIRI_NO_STD=1 run_tests_minimal no_std
177180
;;
178181
i686-pc-windows-msvc)
179182
# Host
180-
# Without GC_STRESS and with reduced many-seeds count as this is the slowest runner.
181-
# (The macOS runner checks windows-msvc with full many-seeds count.)
183+
# Without GC_STRESS as this is the slowest runner.
182184
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 run_tests
183185
# Extra tier 1
184186
# We really want to ensure a Linux target works on a Windows host,

0 commit comments

Comments
 (0)