Skip to content

Commit

Permalink
tools: Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Oct 23, 2023
1 parent fd51324 commit 3c9b3b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/.cspell/project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,3 @@ xilf
xmmword
xsave
xsub
Zsanitizer
2 changes: 1 addition & 1 deletion tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions tools/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 "$@"
Expand Down

0 comments on commit 3c9b3b8

Please sign in to comment.