Skip to content

Commit 93d3f68

Browse files
committed
also test on x86-32 and arm-64 linux hosts
1 parent 205f63e commit 93d3f68

File tree

5 files changed

+59
-28
lines changed

5 files changed

+59
-28
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'

Cargo.lock

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ features = ['unprefixed_malloc_on_supported_platforms']
3737

3838
[target.'cfg(unix)'.dependencies]
3939
libc = "0.2"
40-
libffi = "4.0.0"
40+
libffi = { git = "https://github.com/RalfJung/libffi-rs", branch = "multilib" }
4141
libloading = "0.8"
4242

4343
[target.'cfg(target_os = "linux")'.dependencies]

ci/ci.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ begingroup "Building Miri"
2828
export RUSTFLAGS="-D warnings"
2929
export CARGO_INCREMENTAL=0
3030
export CARGO_EXTRA_FLAGS="--locked"
31+
case $HOST_TARGET in
32+
armv7-unknown-linux-gnueabihf)
33+
RUSTFLAGS="$RUSTFLAGS -Clinker=arm-linux-gnueabihf-gcc"
34+
;;
35+
esac
3136

3237
# Determine configuration for installed build (used by test-cargo-miri and `./miri bench`).
3338
echo "Installing release version of Miri"
@@ -142,13 +147,22 @@ case $HOST_TARGET in
142147
# Host
143148
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
144149
# Extra tier 1
145-
MANY_SEEDS=64 TEST_TARGET=i686-unknown-linux-gnu run_tests
146150
MANY_SEEDS=64 TEST_TARGET=aarch64-unknown-linux-gnu run_tests
147151
MANY_SEEDS=64 TEST_TARGET=x86_64-apple-darwin run_tests
148152
MANY_SEEDS=64 TEST_TARGET=x86_64-pc-windows-gnu run_tests
153+
;;
154+
i686-unknown-linux-gnu)
155+
# Host
156+
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
149157
# Extra tier 1 candidate
150158
MANY_SEEDS=64 TEST_TARGET=aarch64-pc-windows-msvc run_tests
151159
;;
160+
aarch64-unknown-linux-gnu)
161+
# Host
162+
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
163+
# Custom target JSON file
164+
TEST_TARGET=tests/x86_64-unknown-kernel.json MIRI_NO_STD=1 run_tests_minimal no_std
165+
;;
152166
aarch64-apple-darwin)
153167
# Host
154168
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
@@ -172,13 +186,10 @@ case $HOST_TARGET in
172186
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
173187
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
174188
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
177189
;;
178190
i686-pc-windows-msvc)
179191
# 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.)
192+
# Without GC_STRESS as this is the slowest runner.
182193
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 run_tests
183194
# Extra tier 1
184195
# We really want to ensure a Linux target works on a Windows host,

0 commit comments

Comments
 (0)