Skip to content

Commit

Permalink
ci: add debug testing
Browse files Browse the repository at this point in the history
Previous changes in Rust and LLVM have caused stdarch to be broken in
debug, so add testing to ensure that this is caught.
  • Loading branch information
davidtwco authored and Amanieu committed Nov 6, 2024
1 parent 6d53b8e commit 3629a68
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
profile:
- dev
- release
target:
# Dockers that are run through docker on linux
- i686-unknown-linux-gnu
Expand Down Expand Up @@ -192,6 +195,8 @@ jobs:
- run: cargo generate-lockfile

# Configure some env vars based on matrix configuration
- run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV
shell: bash
- run: echo "NORUN=1" >> $GITHUB_ENV
shell: bash
if: matrix.norun != '' || startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
Expand Down
28 changes: 14 additions & 14 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -ex

export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
export HOST_RUSTFLAGS="${RUSTFLAGS}"
export PROFILE="${PROFILE:="--profile=release"}"

export STDARCH_DISABLE_DEDUP_GUARD=1

Expand Down Expand Up @@ -63,6 +64,7 @@ echo "FEATURES=${FEATURES}"
echo "OBJDUMP=${OBJDUMP}"
echo "STDARCH_DISABLE_ASSERT_INSTR=${STDARCH_DISABLE_ASSERT_INSTR}"
echo "STDARCH_TEST_EVERYTHING=${STDARCH_TEST_EVERYTHING}"
echo "PROFILE=${PROFILE}"

cargo_test() {
cmd="cargo"
Expand Down Expand Up @@ -101,46 +103,44 @@ STD_DETECT="--manifest-path=crates/std_detect/Cargo.toml"
STDARCH_EXAMPLES="--manifest-path=examples/Cargo.toml"
INTRINSIC_TEST="--manifest-path=crates/intrinsic-test/Cargo.toml"

cargo_test "${CORE_ARCH} --release"
cargo_test "${CORE_ARCH} ${PROFILE}"

if [ "$NOSTD" != "1" ]; then
cargo_test "${STD_DETECT}"
cargo_test "${STD_DETECT} --release"
cargo_test "${STD_DETECT} ${PROFILE}"

cargo_test "${STD_DETECT} --no-default-features"
cargo_test "${STD_DETECT} --no-default-features --features=std_detect_file_io"
cargo_test "${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval"
cargo_test "${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval,std_detect_file_io"

cargo_test "${STDARCH_EXAMPLES}"
cargo_test "${STDARCH_EXAMPLES} --release"
cargo_test "${STDARCH_EXAMPLES} ${PROFILE}"
fi

# Test targets compiled with extra features.
case ${TARGET} in
x86*)
export STDARCH_DISABLE_ASSERT_INSTR=1
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx"
cargo_test "--release"
cargo_test "${PROFILE}"
;;
# FIXME: don't build anymore
#mips-*gnu* | mipsel-*gnu*)
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa,+fp64,+mips32r5"
# cargo_test "--release"
# cargo_test "${PROFILE}"
# ;;
mips64*)
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa"
cargo_test "--release"
cargo_test "${PROFILE}"
;;
powerpc64*)
# We don't build the ppc 32-bit targets with these - these targets
# are mostly unsupported for now.
OLD_RUSTFLAGS="${RUSTFLAGS}"
export RUSTFLAGS="${OLD_RUSTFLAGS} -C target-feature=+altivec"
cargo_test "--release"
cargo_test "${PROFILE}"

export RUSTFLAGS="${OLD_RUSTFLAGS} -C target-feature=+vsx"
cargo_test "--release"
cargo_test "${PROFILE}"
;;
*)
;;
Expand All @@ -152,22 +152,22 @@ if [ "${TARGET}" = "aarch64-unknown-linux-gnu" ]; then
CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" \
RUSTFLAGS="$HOST_RUSTFLAGS" \
RUST_LOG=warn \
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
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
)
elif [ "${TARGET}" = "armv7-unknown-linux-gnueabihf" ]; then
(
CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" \
RUSTFLAGS="$HOST_RUSTFLAGS" \
RUST_LOG=warn \
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
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
)
fi

if [ "$NORUN" != "1" ] && [ "$NOSTD" != 1 ]; then
# Test examples
(
cd examples
cargo test --target "$TARGET"
echo test | cargo run --target "$TARGET" --release hex
cargo test --target "$TARGET" "${PROFILE}"
echo test | cargo run --target "$TARGET" "${PROFILE}" hex
)
fi

0 comments on commit 3629a68

Please sign in to comment.