From 87862377e49886db103e56281ab74eb0b30c880e Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 20 Feb 2022 11:58:23 +0900 Subject: [PATCH] Enable -Z randomize-layout in miri CI --- ci/crossbeam-epoch-loom.sh | 2 +- ci/miri.sh | 2 ++ ci/san.sh | 24 ++++++++++++------------ ci/test.sh | 2 -- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ci/crossbeam-epoch-loom.sh b/ci/crossbeam-epoch-loom.sh index 750860208..59044ec03 100755 --- a/ci/crossbeam-epoch-loom.sh +++ b/ci/crossbeam-epoch-loom.sh @@ -3,7 +3,7 @@ set -euxo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/../crossbeam-epoch -export RUSTFLAGS="-D warnings --cfg crossbeam_loom --cfg crossbeam_sanitize" +export RUSTFLAGS="${RUSTFLAGS:-} --cfg crossbeam_loom --cfg crossbeam_sanitize" # With MAX_PREEMPTIONS=2 the loom tests (currently) take around 11m. # If we were to run with =3, they would take several times that, diff --git a/ci/miri.sh b/ci/miri.sh index 70acd2a4c..80186b45f 100755 --- a/ci/miri.sh +++ b/ci/miri.sh @@ -3,6 +3,8 @@ set -euxo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/.. +export RUSTFLAGS="${RUSTFLAGS:-} -Z randomize-layout" + MIRIFLAGS="-Zmiri-check-number-validity -Zmiri-symbolic-alignment-check -Zmiri-tag-raw-pointers" \ cargo miri test \ -p crossbeam-queue diff --git a/ci/san.sh b/ci/san.sh index 28ad8f072..0923f6759 100755 --- a/ci/san.sh +++ b/ci/san.sh @@ -14,25 +14,25 @@ rustup component add rust-src # `cfg(crossbeam_sanitize)` with `cfg(sanitize = "..")` and remove # `--cfg crossbeam_sanitize`. cargo clean -RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \ -cargo test --all --release --target x86_64-unknown-linux-gnu --tests \ +RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \ + cargo test --all --release --target x86_64-unknown-linux-gnu --tests \ --exclude crossbeam-skiplist --exclude benchmarks -- --test-threads=1 # There are memory leaks in crossbeam-skiplist. # https://github.com/crossbeam-rs/crossbeam/issues/614 cargo clean -RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \ -cargo test --release --target x86_64-unknown-linux-gnu \ +RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \ + cargo test --release --target x86_64-unknown-linux-gnu \ -p crossbeam-skiplist --test map --test set cargo clean ASAN_OPTIONS="detect_leaks=0" \ -RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \ -cargo test --release --target x86_64-unknown-linux-gnu \ + RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \ + cargo test --release --target x86_64-unknown-linux-gnu \ -p crossbeam-skiplist --tests cargo clean -RUSTFLAGS="-Dwarnings -Zsanitizer=address --cfg crossbeam_sanitize" \ -cargo run \ +RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=address --cfg crossbeam_sanitize" \ + cargo run \ --release \ --target x86_64-unknown-linux-gnu \ --features nightly \ @@ -41,11 +41,11 @@ cargo run \ # Run memory sanitizer cargo clean -RUSTFLAGS="-Dwarnings -Zsanitizer=memory --cfg crossbeam_sanitize" \ -cargo test -Zbuild-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1 +RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=memory --cfg crossbeam_sanitize" \ + cargo test -Z build-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1 # Run thread sanitizer cargo clean TSAN_OPTIONS="suppressions=$(pwd)/ci/tsan" \ -RUSTFLAGS="-Dwarnings -Zsanitizer=thread --cfg crossbeam_sanitize" \ -cargo test -Zbuild-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1 +RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=thread --cfg crossbeam_sanitize" \ + cargo test -Z build-std --all --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1 diff --git a/ci/test.sh b/ci/test.sh index 0bde3e22e..ab70b5e2e 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -3,8 +3,6 @@ set -euxo pipefail IFS=$'\n\t' cd "$(dirname "$0")"/.. -export RUSTFLAGS="-D warnings" - if [[ -n "${RUST_TARGET:-}" ]]; then # If RUST_TARGET is specified, use cross for testing. cross test --all --target "$RUST_TARGET" --exclude benchmarks -- --test-threads=1