From f5220a463d3d91dd8ae0a7f398bf419f1cd4e3a7 Mon Sep 17 00:00:00 2001 From: yihau Date: Wed, 15 Mar 2023 23:42:54 +0800 Subject: [PATCH 1/6] ci: fix do-audit don't retport error --- ci/do-audit.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/do-audit.sh b/ci/do-audit.sh index d7c16187d71e2a..b67d532e2aebec 100755 --- a/ci/do-audit.sh +++ b/ci/do-audit.sh @@ -30,3 +30,7 @@ cargo_audit_ignores=( --ignore RUSTSEC-2023-0001 ) scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter +# avoid the pipeline swallows the error +if [[ "${PIPESTATUS[0]}" -ne 0 ]]; then + exit 1 +fi From 88657709be58ce24d2b7c4e47be1784df5e5f9bf Mon Sep 17 00:00:00 2001 From: Yihau Chen Date: Thu, 16 Mar 2023 00:08:15 +0800 Subject: [PATCH 2/6] Update ci/do-audit.sh Co-authored-by: Trent Nelson --- ci/do-audit.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ci/do-audit.sh b/ci/do-audit.sh index b67d532e2aebec..84957c8dbc2c1b 100755 --- a/ci/do-audit.sh +++ b/ci/do-audit.sh @@ -29,8 +29,9 @@ cargo_audit_ignores=( # https://github.com/solana-labs/solana/issues/29586 --ignore RUSTSEC-2023-0001 ) -scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter -# avoid the pipeline swallows the error -if [[ "${PIPESTATUS[0]}" -ne 0 ]]; then - exit 1 -fi +( + set +e + scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter + # we want the `cargo audit` exit code, not `$dep_tree_filter`'s + exit ${PIPESTATUS[0]} +) From 2edac64ae0a4df87886e4cc7852de37d77b19f9d Mon Sep 17 00:00:00 2001 From: yihau Date: Thu, 16 Mar 2023 00:13:38 +0800 Subject: [PATCH 3/6] use the latest suggestion --- ci/do-audit.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ci/do-audit.sh b/ci/do-audit.sh index 84957c8dbc2c1b..a3dc5386934a8c 100755 --- a/ci/do-audit.sh +++ b/ci/do-audit.sh @@ -29,9 +29,6 @@ cargo_audit_ignores=( # https://github.com/solana-labs/solana/issues/29586 --ignore RUSTSEC-2023-0001 ) -( - set +e - scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter - # we want the `cargo audit` exit code, not `$dep_tree_filter`'s - exit ${PIPESTATUS[0]} -) +scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter +# we want the `cargo audit` exit code, not `$dep_tree_filter`'s +exit ${PIPESTATUS[0]} From ca2a97a44a11450e0dec7d39c0247eeeb2c4a131 Mon Sep 17 00:00:00 2001 From: yihau Date: Thu, 16 Mar 2023 00:16:26 +0800 Subject: [PATCH 4/6] lint --- ci/do-audit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/do-audit.sh b/ci/do-audit.sh index a3dc5386934a8c..216480ed1eaa2c 100755 --- a/ci/do-audit.sh +++ b/ci/do-audit.sh @@ -31,4 +31,4 @@ cargo_audit_ignores=( ) scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter # we want the `cargo audit` exit code, not `$dep_tree_filter`'s -exit ${PIPESTATUS[0]} +exit "${PIPESTATUS[0]}" From 9770f42f0be870ff5658da08830bb86a18f58fb3 Mon Sep 17 00:00:00 2001 From: yihau Date: Thu, 16 Mar 2023 00:54:40 +0800 Subject: [PATCH 5/6] redirect stderr to stdout --- ci/do-audit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/do-audit.sh b/ci/do-audit.sh index 216480ed1eaa2c..53bce7ce878c45 100755 --- a/ci/do-audit.sh +++ b/ci/do-audit.sh @@ -29,6 +29,6 @@ cargo_audit_ignores=( # https://github.com/solana-labs/solana/issues/29586 --ignore RUSTSEC-2023-0001 ) -scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter +scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" |& $dep_tree_filter # we want the `cargo audit` exit code, not `$dep_tree_filter`'s exit "${PIPESTATUS[0]}" From 3b551a6cb2d09be776d8648336bcc027207cee73 Mon Sep 17 00:00:00 2001 From: yihau Date: Thu, 16 Mar 2023 02:23:02 +0800 Subject: [PATCH 6/6] another solution --- ci/do-audit.sh | 2 +- ci/docker-run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/do-audit.sh b/ci/do-audit.sh index 53bce7ce878c45..216480ed1eaa2c 100755 --- a/ci/do-audit.sh +++ b/ci/do-audit.sh @@ -29,6 +29,6 @@ cargo_audit_ignores=( # https://github.com/solana-labs/solana/issues/29586 --ignore RUSTSEC-2023-0001 ) -scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" |& $dep_tree_filter +scripts/cargo-for-all-lock-files.sh audit "${cargo_audit_ignores[@]}" | $dep_tree_filter # we want the `cargo audit` exit code, not `$dep_tree_filter`'s exit "${PIPESTATUS[0]}" diff --git a/ci/docker-run.sh b/ci/docker-run.sh index 0df66f2a881b05..b7a1c3a4d05efa 100755 --- a/ci/docker-run.sh +++ b/ci/docker-run.sh @@ -125,4 +125,4 @@ fi set -x # shellcheck disable=SC2086 -exec docker run "${ARGS[@]}" $CODECOV_ENVS "$IMAGE" "$@" +exec docker run "${ARGS[@]}" $CODECOV_ENVS -t "$IMAGE" "$@"