From 084f3705a73a72dd681e2f47291ff83329676f73 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 20 Nov 2024 04:41:31 -0500 Subject: [PATCH 1/2] ci: Ensure build channels get run even if FILTER is unset In 59a18de777("ci: Set `-u` (error on unset)..."), `-u` started being passed to the `set` call in shell scripts. This broke the `FILTER` logic since now the command always fails. Make this a bit less fragile by explicitly setting to an empty string, as well as adding a check that at least one test got run. --- ci/build.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ci/build.sh b/ci/build.sh index f2a56445c7690..b9628e6a52110 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -11,6 +11,7 @@ set -eux : "${OS?The OS environment variable must be set.}" rust="$TOOLCHAIN" +filter="${FILTER:-}" echo "Testing Rust $rust on $OS" @@ -196,13 +197,15 @@ case "${OS}" in esac for target in $targets; do - if echo "$target" | grep -q "$FILTER"; then + if echo "$target" | grep -q "$filter"; then if [ "${OS}" = "windows" ]; then TARGET="$target" sh ./ci/install-rust.sh test_target build "$target" else test_target build "$target" fi + + test_run=1 fi done @@ -276,8 +279,10 @@ x86_64-wrs-vxworks \ if [ "${rust}" = "nightly" ] && [ "${OS}" = "linux" ]; then for target in $rust_linux_no_core_targets; do if echo "$target" | grep -q "$FILTER"; then - test_target build "$target" 1 + test_target "$target" 1 fi + + test_run=1 done fi @@ -290,7 +295,15 @@ i386-apple-ios \ if [ "${rust}" = "nightly" ] && [ "${OS}" = "macos" ]; then for target in $rust_apple_no_core_targets; do if echo "$target" | grep -q "$FILTER"; then - test_target build "$target" 1 + test_target "$target" 1 fi + + test_run=1 done fi + +# Make sure we didn't accidentally filter everything +if [ "${test_run:-}" != 1 ]; then + echo "No tests were run" + exit 1 +fi From 907c6d66f8ebae153a1d0e381fad1303f9eb96be Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Wed, 20 Nov 2024 05:04:59 -0500 Subject: [PATCH 2/2] ci: Ensure there is a fallback for `no_std` --- ci/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build.sh b/ci/build.sh index b9628e6a52110..f9c81beb19672 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -22,7 +22,7 @@ fi test_target() { build_cmd="${1}" target="${2}" - no_std="${3}" + no_std="${3:-}" # If there is a std component, fetch it: if [ "${no_std}" != "1" ]; then