Skip to content

Commit

Permalink
Use stable Rust for address sanitizer (#734)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Install stable Rust

Signed-off-by: James Bornholt <[email protected]>

---------

Signed-off-by: James Bornholt <[email protected]>
  • Loading branch information
jamesbornholt authored Feb 6, 2024
1 parent 4eba52d commit 05f6cc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 \
Expand Down

0 comments on commit 05f6cc3

Please sign in to comment.