From 3c9b3b8b41cba071dacc84c0d268529d8b2114a1 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 23 Oct 2023 20:39:16 +0900 Subject: [PATCH] tools: Update scripts --- .github/.cspell/project-dictionary.txt | 1 - tools/build.sh | 2 +- tools/test.sh | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/.cspell/project-dictionary.txt b/.github/.cspell/project-dictionary.txt index b4f781a9..417acb6b 100644 --- a/.github/.cspell/project-dictionary.txt +++ b/.github/.cspell/project-dictionary.txt @@ -176,4 +176,3 @@ xilf xmmword xsave xsub -Zsanitizer diff --git a/tools/build.sh b/tools/build.sh index a3e9b8bd..7abda86a 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -235,7 +235,7 @@ if [[ "${rustc_version}" == *"nightly"* ]] || [[ "${rustc_version}" == *"dev"* ] # -Z check-cfg requires 1.63.0-nightly # we only check this on the recent nightly to avoid old clippy bugs. # shellcheck disable=SC2207 - if [[ "${rustc_minor_version}" -ge 74 ]] && [[ -n "${TESTS:-}" ]] && [[ -z "${TARGET_GROUP:-}" ]]; then + if [[ "${rustc_minor_version}" -ge 75 ]] && [[ -n "${TESTS:-}" ]] && [[ -z "${TARGET_GROUP:-}" ]]; then build_scripts=(build.rs portable-atomic-util/build.rs) check_cfg='-Z unstable-options --check-cfg=values(target_pointer_width,"128") --check-cfg=values(target_arch,"xtensa") --check-cfg=values(feature,"cargo-clippy")' known_cfgs+=($(grep -E 'cargo:rustc-cfg=' "${build_scripts[@]}" | sed -E 's/^.*cargo:rustc-cfg=//; s/(=\\)?".*$//' | LC_ALL=C sort -u)) diff --git a/tools/test.sh b/tools/test.sh index 7f374bf2..c9160650 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -214,7 +214,7 @@ esac run() { if [[ ${#release[@]} -eq 0 ]]; then - if [[ "${RUSTFLAGS:-}" == *"-Z sanitizer="* ]] || [[ "${RUSTFLAGS:-}" == *"-Zsanitizer="* ]]; then + if [[ "${RUSTFLAGS:-}" =~ -Z( )?sanitizer= ]]; then # doctest with debug build on Sanitizer is slow x_cargo test ${build_std[@]+"${build_std[@]}"} --tests "$@" else @@ -223,7 +223,7 @@ run() { fi # release mode + doctests is slow on some platforms (probably related to the fact that they compile binaries for each example) - if [[ "${RUSTFLAGS:-}" == *"-Z sanitizer=memory"* ]] || [[ "${RUSTFLAGS:-}" == *"-Zsanitizer=memory"* ]]; then + if [[ "${RUSTFLAGS:-}" =~ -Z( )?sanitizer=memory ]]; then # Workaround https://github.com/google/sanitizers/issues/558 CARGO_PROFILE_RELEASE_OPT_LEVEL=0 \ x_cargo test ${build_std[@]+"${build_std[@]}"} --release --tests "$@"