Skip to content

Commit 358abb4

Browse files
committed
test on x86-32 and arm-32
1 parent 7d09c38 commit 358abb4

File tree

3 files changed

+41
-25
lines changed

3 files changed

+41
-25
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,23 @@ defaults:
1414

1515
jobs:
1616
test:
17-
name: build and test on ${{ matrix.host_target }}
17+
name: test (${{ matrix.host_target }})
1818
strategy:
1919
fail-fast: false
2020
matrix:
2121
include:
2222
- host_target: x86_64-unknown-linux-gnu
2323
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
24+
- host_target: i686-unknown-linux-gnu
25+
os: ubuntu-latest
26+
multiarch: i386
27+
gcc_cross: i686-linux-gnu
2728
- host_target: aarch64-unknown-linux-gnu
2829
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
30+
- host_target: armv7-unknown-linux-gnueabihf
31+
os: ubuntu-24.04-arm
32+
multiarch: armhf
33+
gcc_cross: arm-linux-gnueabihf
3234
- host_target: aarch64-apple-darwin
3335
os: macos-latest
3436
- host_target: i686-pc-windows-msvc
@@ -38,22 +40,27 @@ jobs:
3840
HOST_TARGET: ${{ matrix.host_target }}
3941
steps:
4042
- 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' }}
43+
- name: install multiarch
44+
if: ${{ matrix.multiarch != '' }}
4945
run: |
50-
sudo dpkg --add-architecture armhf
46+
sudo dpkg --add-architecture ${{ matrix.multiarch }}
5147
sudo apt update
52-
sudo apt install gcc-arm-linux-gnueabihf zlib1g-dev:armhf libffi-dev:armhf
48+
sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
5349
- uses: ./.github/workflows/setup
5450
with:
5551
toolchain_flags: "--host ${{ matrix.host_target }}"
5652

53+
# We set up the cross-compiler *after* the basic setup as setting CC would otherwise
54+
# cause confusion.
55+
- name: install gcc-cross
56+
if: ${{ matrix.gcc_cross != '' }}
57+
run: |
58+
sudo apt install gcc-${{ matrix.gcc_cross }}
59+
echo "Setting environment variables:"
60+
echo "CC=${{ matrix.gcc_cross }}-gcc" | tee -a $GITHUB_ENV
61+
TARGET_UPPERCASE=$(echo ${{ matrix.host_target }} | tr '[:lower:]-' '[:upper:]_')
62+
echo "CARGO_TARGET_${TARGET_UPPERCASE}_LINKER=${{ matrix.gcc_cross }}-gcc" | tee -a $GITHUB_ENV
63+
5764
- name: Test Miri
5865
run: ./ci/ci.sh
5966

.github/workflows/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ runs:
3636
key: cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }}-v1
3737
restore-keys: cargo-${{ runner.os }}-${{ runner.arch }}
3838

39-
- name: Install rustup-toolchain-install-master
39+
- name: Install the tools we need
4040
if: steps.cache.outputs.cache-hit != 'true'
4141
run: cargo install -f rustup-toolchain-install-master hyperfine
4242
shell: bash

ci/ci.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,18 @@ case $HOST_TARGET in
146146
MANY_SEEDS=64 TEST_TARGET=x86_64-apple-darwin run_tests
147147
MANY_SEEDS=64 TEST_TARGET=x86_64-pc-windows-gnu run_tests
148148
;;
149+
i686-unknown-linux-gnu)
150+
# Host
151+
# Without GC_STRESS as this is a slow runner.
152+
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
153+
# Partially supported targets (tier 2)
154+
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
155+
UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
156+
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd
157+
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
158+
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
159+
TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std
160+
;;
149161
aarch64-unknown-linux-gnu)
150162
# Host
151163
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
@@ -154,6 +166,10 @@ case $HOST_TARGET in
154166
# Custom target JSON file
155167
TEST_TARGET=tests/x86_64-unknown-kernel.json MIRI_NO_STD=1 run_tests_minimal no_std
156168
;;
169+
armv7-unknown-linux-gnueabihf)
170+
# Host
171+
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
172+
;;
157173
aarch64-apple-darwin)
158174
# Host
159175
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
@@ -170,13 +186,6 @@ case $HOST_TARGET in
170186
MANY_SEEDS=16 TEST_TARGET=x86_64-pc-solaris run_tests
171187
MANY_SEEDS=16 TEST_TARGET=x86_64-unknown-freebsd run_tests
172188
MANY_SEEDS=16 TEST_TARGET=i686-unknown-freebsd run_tests
173-
# Partially supported targets (tier 2)
174-
BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
175-
UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
176-
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd
177-
TEST_TARGET=wasm32-wasip2 run_tests_minimal $BASIC wasm
178-
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
179-
TEST_TARGET=thumbv7em-none-eabihf run_tests_minimal no_std
180189
;;
181190
i686-pc-windows-msvc)
182191
# Host

0 commit comments

Comments
 (0)