Skip to content

Commit 74773fe

Browse files
committed
ci: add debug testing
Previous changes in Rust and LLVM have caused stdarch to be broken in debug, so add testing to ensure that this is caught.
1 parent 6d53b8e commit 74773fe

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

.github/workflows/main.yml

+5
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ jobs:
6868
runs-on: ${{ matrix.os }}
6969
strategy:
7070
matrix:
71+
profile:
72+
- dev
73+
- release
7174
target:
7275
# Dockers that are run through docker on linux
7376
- i686-unknown-linux-gnu
@@ -192,6 +195,8 @@ jobs:
192195
- run: cargo generate-lockfile
193196

194197
# Configure some env vars based on matrix configuration
198+
- run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV
199+
shell: bash
195200
- run: echo "NORUN=1" >> $GITHUB_ENV
196201
shell: bash
197202
if: matrix.norun != '' || startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'

ci/run.sh

+14-14
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set -ex
1212

1313
export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
1414
export HOST_RUSTFLAGS="${RUSTFLAGS}"
15+
export PROFILE="${PROFILE:="--profile=release"}"
1516

1617
export STDARCH_DISABLE_DEDUP_GUARD=1
1718

@@ -63,6 +64,7 @@ echo "FEATURES=${FEATURES}"
6364
echo "OBJDUMP=${OBJDUMP}"
6465
echo "STDARCH_DISABLE_ASSERT_INSTR=${STDARCH_DISABLE_ASSERT_INSTR}"
6566
echo "STDARCH_TEST_EVERYTHING=${STDARCH_TEST_EVERYTHING}"
67+
echo "PROFILE=${PROFILE}"
6668

6769
cargo_test() {
6870
cmd="cargo"
@@ -101,46 +103,44 @@ STD_DETECT="--manifest-path=crates/std_detect/Cargo.toml"
101103
STDARCH_EXAMPLES="--manifest-path=examples/Cargo.toml"
102104
INTRINSIC_TEST="--manifest-path=crates/intrinsic-test/Cargo.toml"
103105

104-
cargo_test "${CORE_ARCH} --release"
106+
cargo_test "${CORE_ARCH} ${PROFILE}"
105107

106108
if [ "$NOSTD" != "1" ]; then
107-
cargo_test "${STD_DETECT}"
108-
cargo_test "${STD_DETECT} --release"
109+
cargo_test "${STD_DETECT} ${PROFILE}"
109110

110111
cargo_test "${STD_DETECT} --no-default-features"
111112
cargo_test "${STD_DETECT} --no-default-features --features=std_detect_file_io"
112113
cargo_test "${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval"
113114
cargo_test "${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval,std_detect_file_io"
114115

115-
cargo_test "${STDARCH_EXAMPLES}"
116-
cargo_test "${STDARCH_EXAMPLES} --release"
116+
cargo_test "${STDARCH_EXAMPLES} ${PROFILE}"
117117
fi
118118

119119
# Test targets compiled with extra features.
120120
case ${TARGET} in
121121
x86*)
122122
export STDARCH_DISABLE_ASSERT_INSTR=1
123123
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx"
124-
cargo_test "--release"
124+
cargo_test "${PROFILE}"
125125
;;
126126
# FIXME: don't build anymore
127127
#mips-*gnu* | mipsel-*gnu*)
128128
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa,+fp64,+mips32r5"
129-
# cargo_test "--release"
129+
# cargo_test "${PROFILE}"
130130
# ;;
131131
mips64*)
132132
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa"
133-
cargo_test "--release"
133+
cargo_test "${PROFILE}"
134134
;;
135135
powerpc64*)
136136
# We don't build the ppc 32-bit targets with these - these targets
137137
# are mostly unsupported for now.
138138
OLD_RUSTFLAGS="${RUSTFLAGS}"
139139
export RUSTFLAGS="${OLD_RUSTFLAGS} -C target-feature=+altivec"
140-
cargo_test "--release"
140+
cargo_test "${PROFILE}"
141141

142142
export RUSTFLAGS="${OLD_RUSTFLAGS} -C target-feature=+vsx"
143-
cargo_test "--release"
143+
cargo_test "${PROFILE}"
144144
;;
145145
*)
146146
;;
@@ -152,22 +152,22 @@ if [ "${TARGET}" = "aarch64-unknown-linux-gnu" ]; then
152152
CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" \
153153
RUSTFLAGS="$HOST_RUSTFLAGS" \
154154
RUST_LOG=warn \
155-
cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_aarch64.txt
155+
cargo run ${INTRINSIC_TEST} "${PROFILE}" --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_aarch64.txt
156156
)
157157
elif [ "${TARGET}" = "armv7-unknown-linux-gnueabihf" ]; then
158158
(
159159
CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" \
160160
RUSTFLAGS="$HOST_RUSTFLAGS" \
161161
RUST_LOG=warn \
162-
cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_arm.txt --a32
162+
cargo run ${INTRINSIC_TEST} "${PROFILE}" --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_arm.txt --a32
163163
)
164164
fi
165165

166166
if [ "$NORUN" != "1" ] && [ "$NOSTD" != 1 ]; then
167167
# Test examples
168168
(
169169
cd examples
170-
cargo test --target "$TARGET"
171-
echo test | cargo run --target "$TARGET" --release hex
170+
cargo test --target "$TARGET" "${PROFILE}"
171+
echo test | cargo run --target "$TARGET" "${PROFILE}" hex
172172
)
173173
fi

0 commit comments

Comments
 (0)