From 53a6cb76d6d1e54dab6eca21a41e3461e53521eb Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 9 Jun 2020 11:56:45 +0900 Subject: [PATCH 1/3] Run clippy before check to avoid being skipped --- ci/test-checks.sh | 10 ++++++---- scripts/cargo-for-all-lock-files.sh | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ci/test-checks.sh b/ci/test-checks.sh index 908a18a3ec8eee..3fe18165b759c0 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -13,20 +13,22 @@ export RUSTFLAGS="-D warnings" # Look for failed mergify.io backports _ git show HEAD --check --oneline +# `clippy` must be run before `check`; otherwise `clippy` wouldn't be run due to +# too aggresive cargo's caching! +_ cargo +"$rust_nightly" clippy --version +_ cargo +"$rust_nightly" clippy --workspace --all-targets -- --deny=warnings + if _ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets; then true else check_status=$? echo "Some Cargo.lock is outdated; please update them as well" - echo "protip: you can use ./scripts/cargo-for-all-lock-files.sh update ..." + echo "protip: you can use ./scripts/cargo-for-all-lock-files.sh [check|update] ..." exit "$check_status" fi _ cargo +"$rust_stable" fmt --all -- --check -_ cargo +"$rust_nightly" clippy --version -_ cargo +"$rust_nightly" clippy --workspace --all-targets -- --deny=warnings - _ cargo +"$rust_stable" audit --version _ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit --ignore RUSTSEC-2020-0002 --ignore RUSTSEC-2020-0008 _ ci/nits.sh diff --git a/scripts/cargo-for-all-lock-files.sh b/scripts/cargo-for-all-lock-files.sh index 9a635853aa3b9f..d26cd12358d48c 100755 --- a/scripts/cargo-for-all-lock-files.sh +++ b/scripts/cargo-for-all-lock-files.sh @@ -30,6 +30,9 @@ else fi for lock_file in $files; do + if [[ -n $CI ]]; then + echo "--- cargo[$lock_file]: " "${shifted_args[@]}" "$@" + fi ( set -x cd "$(dirname "$lock_file")" From 092e5df0989fc4e49dbcccc41f7b1426987d3b4e Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 9 Jun 2020 12:11:24 +0900 Subject: [PATCH 2/3] Tweak output --- scripts/cargo-for-all-lock-files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cargo-for-all-lock-files.sh b/scripts/cargo-for-all-lock-files.sh index d26cd12358d48c..8de7bccb867330 100755 --- a/scripts/cargo-for-all-lock-files.sh +++ b/scripts/cargo-for-all-lock-files.sh @@ -31,7 +31,7 @@ fi for lock_file in $files; do if [[ -n $CI ]]; then - echo "--- cargo[$lock_file]: " "${shifted_args[@]}" "$@" + echo "--- [$lock_file]: cargo " "${shifted_args[@]}" "$@" fi ( set -x From 04d09c31b7d121151cccb359b454f35da05ae8f0 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 9 Jun 2020 12:17:30 +0900 Subject: [PATCH 3/3] Apply a workaround --- ci/test-checks.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ci/test-checks.sh b/ci/test-checks.sh index 3fe18165b759c0..3d6b2c6cf2eb74 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -13,11 +13,6 @@ export RUSTFLAGS="-D warnings" # Look for failed mergify.io backports _ git show HEAD --check --oneline -# `clippy` must be run before `check`; otherwise `clippy` wouldn't be run due to -# too aggresive cargo's caching! -_ cargo +"$rust_nightly" clippy --version -_ cargo +"$rust_nightly" clippy --workspace --all-targets -- --deny=warnings - if _ scripts/cargo-for-all-lock-files.sh +"$rust_nightly" check --locked --all-targets; then true else @@ -29,6 +24,10 @@ fi _ cargo +"$rust_stable" fmt --all -- --check +# -Z... is needed because of clippy bug: https://github.com/rust-lang/rust-clippy/issues/4612 +_ cargo +"$rust_nightly" clippy -Zunstable-options --version +_ cargo +"$rust_nightly" clippy -Zunstable-options --workspace --all-targets -- --deny=warnings + _ cargo +"$rust_stable" audit --version _ scripts/cargo-for-all-lock-files.sh +"$rust_stable" audit --ignore RUSTSEC-2020-0002 --ignore RUSTSEC-2020-0008 _ ci/nits.sh