Skip to content

Commit feb1dcd

Browse files
committed
Modify the CI scripts to work with the new design
1 parent 2fefc69 commit feb1dcd

6 files changed

Lines changed: 34 additions & 99 deletions

File tree

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ jobs:
277277
- aarch64-unknown-linux-gnu
278278
- aarch64_be-unknown-linux-gnu
279279
- armv7-unknown-linux-gnueabihf
280-
- arm-unknown-linux-gnueabihf
281280
- x86_64-unknown-linux-gnu
282281
profile: [dev, release]
283282
include:

ci/docker/aarch64-unknown-linux-gnu/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
FROM ubuntu:25.10
22
RUN apt-get update && apt-get install -y --no-install-recommends \
33
gcc \
4-
g++ \
54
ca-certificates \
65
libc6-dev \
76
gcc-aarch64-linux-gnu \
8-
g++-aarch64-linux-gnu \
97
libc6-dev-arm64-cross \
108
qemu-user \
119
make \

ci/docker/aarch64_be-unknown-linux-gnu/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM ubuntu:25.10
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
44
gcc \
5-
g++ \
65
ca-certificates \
76
libc6-dev \
87
libc6-dev-arm64-cross \

ci/docker/arm-unknown-linux-gnueabihf/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
77
libc6-dev-armhf-cross \
88
qemu-user \
99
make \
10-
file
10+
file \
11+
clang \
12+
lld
1113
ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
1214
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -cpu max -L /usr/arm-linux-gnueabihf" \
1315
OBJDUMP=arm-linux-gnueabihf-objdump

ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
FROM ubuntu:24.04
22
RUN apt-get update && apt-get install -y --no-install-recommends \
33
gcc \
4-
g++ \
54
ca-certificates \
65
libc6-dev \
76
gcc-arm-linux-gnueabihf \
8-
g++-arm-linux-gnueabihf \
97
libc6-dev-armhf-cross \
108
qemu-user \
119
make \

ci/intrinsic-test.sh

Lines changed: 31 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -5,127 +5,66 @@ set -ex
55
: "${TARGET?The TARGET environment variable must be set.}"
66

77
export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled -Z verify-llvm-ir"
8-
export HOST_RUSTFLAGS="${RUSTFLAGS}"
98
export PROFILE="${PROFILE:="release"}"
109

11-
case ${TARGET} in
12-
# On 32-bit use a static relocation model which avoids some extra
13-
# instructions when dealing with static data, notably allowing some
14-
# instruction assertion checks to pass below the 20 instruction limit. If
15-
# this is the default, dynamic, then too many instructions are generated
16-
# when we assert the instruction for a function and it causes tests to fail.
17-
i686-* | i586-*)
18-
export RUSTFLAGS="${RUSTFLAGS} -C relocation-model=static"
19-
;;
20-
# Some x86_64 targets enable by default more features beyond SSE2,
21-
# which cause some instruction assertion checks to fail.
22-
x86_64-*)
23-
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=-sse3"
24-
;;
25-
#Unoptimized build uses fast-isel which breaks with msa
26-
mips-* | mipsel-*)
27-
export RUSTFLAGS="${RUSTFLAGS} -C llvm-args=-fast-isel=false"
28-
;;
29-
armv7-*eabihf | thumbv7-*eabihf)
30-
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+neon"
31-
;;
32-
# Some of our test dependencies use the deprecated `gcc` crates which
33-
# doesn't detect RISC-V compilers automatically, so do it manually here.
34-
riscv*)
35-
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+zk,+zks,+zbb,+zbc"
36-
;;
37-
esac
38-
3910
echo "RUSTFLAGS=${RUSTFLAGS}"
40-
echo "OBJDUMP=${OBJDUMP}"
4111
echo "PROFILE=${PROFILE}"
4212

4313
INTRINSIC_TEST="--manifest-path=crates/intrinsic-test/Cargo.toml"
4414

45-
# Test targets compiled with extra features.
15+
export CC="clang"
16+
4617
case ${TARGET} in
47-
# Setup aarch64 & armv7 specific variables, the runner, along with some
48-
# tests to skip
49-
aarch64-unknown-linux-gnu*)
50-
TEST_CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/"
51-
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64.txt
52-
TEST_CXX_COMPILER="clang++"
53-
TEST_RUNNER="${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}"
54-
: "${TEST_SAMPLE_INTRINSICS_PERCENTAGE:=100}"
18+
aarch64_be*)
19+
export CFLAGS="-I${AARCH64_BE_TOOLCHAIN}/aarch64_be-none-linux-gnu/include/"
20+
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64_be.txt
5521
;;
5622

57-
aarch64_be-unknown-linux-gnu*)
58-
TEST_CPPFLAGS="-fuse-ld=lld"
59-
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64_be.txt
60-
TEST_CXX_COMPILER="clang++"
61-
TEST_RUNNER="${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER}"
62-
: "${TEST_SAMPLE_INTRINSICS_PERCENTAGE:=100}"
23+
aarch64*)
24+
export CFLAGS="-I/usr/aarch64-linux-gnu/include/"
25+
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64.txt
6326
;;
6427

65-
armv7-unknown-linux-gnueabihf*)
66-
TEST_CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/"
28+
armv7*)
29+
export CFLAGS="-I/usr/arm-linux-gnueabihf/include/"
6730
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_arm.txt
68-
TEST_CXX_COMPILER="clang++"
69-
TEST_RUNNER="${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}"
70-
: "${TEST_SAMPLE_INTRINSICS_PERCENTAGE:=100}"
7131
;;
7232

73-
x86_64-unknown-linux-gnu*)
74-
TEST_CPPFLAGS="-fuse-ld=lld -I/usr/include/x86_64-linux-gnu/"
75-
TEST_CXX_COMPILER="clang++"
76-
TEST_RUNNER="${CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER}"
33+
x86_64*)
34+
export CFLAGS="-I/usr/include/x86_64-linux-gnu/"
7735
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_x86.txt
78-
: "${TEST_SAMPLE_INTRINSICS_PERCENTAGE:=20}"
7936
;;
8037
*)
8138
;;
8239

8340
esac
8441

85-
# Arm specific
8642
case "${TARGET}" in
87-
aarch64-unknown-linux-gnu*|armv7-unknown-linux-gnueabihf*)
88-
CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=warn \
89-
cargo run "${INTRINSIC_TEST}" --release \
90-
--bin intrinsic-test -- intrinsics_data/arm_intrinsics.json \
91-
--runner "${TEST_RUNNER}" \
92-
--cppcompiler "${TEST_CXX_COMPILER}" \
43+
x86_64-unknown-linux-gnu*)
44+
env -u CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER \
45+
cargo run "${INTRINSIC_TEST}" --release \
46+
--bin intrinsic-test -- intrinsics_data/x86-intel.xml \
9347
--skip "${TEST_SKIP_INTRINSICS}" \
94-
--target "${TARGET}" \
95-
--profile "${PROFILE}" \
96-
--sample-percentage "${TEST_SAMPLE_INTRINSICS_PERCENTAGE}"
97-
;;
48+
--target "${TARGET}"
9849

99-
aarch64_be-unknown-linux-gnu*)
100-
CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=warn \
101-
cargo run "${INTRINSIC_TEST}" --release \
50+
echo "${CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER}"
51+
;;
52+
*)
53+
cargo run "${INTRINSIC_TEST}" --release \
10254
--bin intrinsic-test -- intrinsics_data/arm_intrinsics.json \
103-
--runner "${TEST_RUNNER}" \
104-
--cppcompiler "${TEST_CXX_COMPILER}" \
10555
--skip "${TEST_SKIP_INTRINSICS}" \
106-
--target "${TARGET}" \
107-
--profile "${PROFILE}" \
108-
--linker "${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER}" \
109-
--cxx-toolchain-dir "${AARCH64_BE_TOOLCHAIN}" \
110-
--sample-percentage "${TEST_SAMPLE_INTRINSICS_PERCENTAGE}"
56+
--target "${TARGET}"
11157
;;
58+
esac
11259

113-
x86_64-unknown-linux-gnu*)
114-
# `CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER` is not necessary for `intrinsic-test`
115-
# because the binary needs to run directly on the host.
116-
# Hence the use of `env -u`.
117-
env -u CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER \
118-
CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" \
119-
RUST_LOG=warn RUST_BACKTRACE=1 \
120-
cargo run "${INTRINSIC_TEST}" --release \
121-
--bin intrinsic-test -- intrinsics_data/x86-intel.xml \
122-
--runner "${TEST_RUNNER}" \
123-
--skip "${TEST_SKIP_INTRINSICS}" \
124-
--cppcompiler "${TEST_CXX_COMPILER}" \
125-
--target "${TARGET}" \
126-
--profile "${PROFILE}" \
127-
--sample-percentage "${TEST_SAMPLE_INTRINSICS_PERCENTAGE}"
60+
case ${TARGET} in
61+
# FIXME: currently this needs enabling because the test functions don't have any `target_feature`attribute
62+
x86_64-*)
63+
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+avx512f"
12864
;;
129-
*)
65+
armv7-* | aarch64*)
66+
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+neon"
13067
;;
13168
esac
69+
70+
cargo test --manifest-path=rust_programs/Cargo.toml --target "${TARGET}" --profile "${PROFILE}"

0 commit comments

Comments
 (0)