From 05f6cc31581ae02180701675db8e6eda2326a7f2 Mon Sep 17 00:00:00 2001 From: James Bornholt Date: Tue, 6 Feb 2024 10:36:45 -0600 Subject: [PATCH] Use stable Rust for address sanitizer (#734) * Use stable Rust for address sanitizer Nightly is broken today, which blocks our CI. This is the third or fourth time this has happened to us, so let's switch over to using the RUSTC_BOOTSTRAP hack to use nightly features on stable Rust. This is scoped only to the ASan makefile target, so it won't actually allow us to use nightly features in our code, just when running the sanitizers. Signed-off-by: James Bornholt * Install stable Rust Signed-off-by: James Bornholt --------- Signed-off-by: James Bornholt --- .github/workflows/integration.yml | 2 +- Makefile | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1a35dd646..139cf06c5 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -200,7 +200,7 @@ jobs: - name: Install nightly Rust uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: stable override: true components: rust-src - name: Restore Cargo cache diff --git a/Makefile b/Makefile index 71d555d71..42de2907b 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,8 @@ test: test-asan-working: @packages=`echo "$(CRATES)" | sed -E 's/(^| )/ -p /g'`; \ RUSTFLAGS="-Zsanitizer=address" \ - cargo +nightly test -Z build-std --target x86_64-unknown-linux-gnu --features $(RUST_FEATURES) $$packages -- --ignored test_asan_working 2>&1 \ + RUSTC_BOOTSTRAP=1 \ + cargo test -Z build-std --target x86_64-unknown-linux-gnu --features $(RUST_FEATURES) $$packages -- --ignored test_asan_working 2>&1 \ | tee /dev/stderr \ | grep "heap-use-after-free" \ && echo "ASan is working" || (echo "ASan did not find the use-after-free; something's wrong"; exit 1) @@ -37,7 +38,8 @@ test-asan: @packages=`echo "$(CRATES)" | sed -E 's/(^| )/ -p /g'`; \ LSAN_OPTIONS=suppressions="$$(pwd)/lsan-suppressions.txt" \ RUSTFLAGS="-Zsanitizer=address" \ - cargo +nightly test -Z build-std --target x86_64-unknown-linux-gnu --features $(RUST_FEATURES) $$packages -- \ + RUSTC_BOOTSTRAP=1 \ + cargo test -Z build-std --target x86_64-unknown-linux-gnu --features $(RUST_FEATURES) $$packages -- \ --skip reftest_ \ --skip proptest_ \ --skip fork_test \