Skip to content

Commit 9fb3bda

Browse files
committed
ci,test: keep a spaced SANITIZE value one make argument end to end
The windows-11-arm leg's first execution (broad matrix, release dry run) died before any test ran: the trap-UBSan SANITIZE value passed unquoted through the workflow ternary, so -fsanitize-trap=undefined arrived as its own word and make consumed the leading -f as its makefile flag ('No rule to make target sanitize-trap=undefined'). - The workflow quotes the ternary value so test.sh receives one argument. - test.sh forwards make arguments through an ARRAY instead of a re-split string, so a VAR=VAL whose value contains spaces survives every boundary (empty-array expansion kept bash-3.2-safe for the macOS runners under set -u). Verified: argument-parse proof (argc=1 with the four-flag value) and a full macOS suite run through the changed plumbing, 6776 passed, 0 failed — identical totals. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent dc7178c commit 9fb3bda

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎.github/workflows/_test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ jobs:
323323
export TEMP="$(cygpath -m "$CBM_CI_TEMP_ROOT")"
324324
export TMP="$TEMP"
325325
export TMPDIR="$(cygpath -u "$CBM_CI_TEMP_ROOT")"
326-
scripts/test.sh CC=clang CXX=clang++ ${{ matrix.os == 'windows-11-arm' && 'SANITIZE=-fsanitize=undefined -fsanitize-trap=undefined -fstack-protector-strong -fno-omit-frame-pointer' || '' }}
326+
scripts/test.sh CC=clang CXX=clang++ ${{ matrix.os == 'windows-11-arm' && '"SANITIZE=-fsanitize=undefined -fsanitize-trap=undefined -fstack-protector-strong -fno-omit-frame-pointer"' || '' }}
327327
env:
328328
CBM_TEST_SHARD: ${{ matrix.shard }}
329329
CBM_TEST_LEG: ${{ matrix.os }}-${{ matrix.msystem }}

‎scripts/test.sh‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,19 @@ source "$ROOT/scripts/path-safety.sh"
4343
# Forward CC/CXX and collect make-passthrough args. BUILD_DIR is honored for
4444
# the explicit target path below so containerized legs can build in their own
4545
# directory instead of clobbering the host's native build/c artifacts.
46-
MAKE_ARGS=""
46+
# MAKE_ARGS is an ARRAY so a VAR=VAL whose value contains spaces (the
47+
# windows-11-arm leg passes SANITIZE with four flags) survives as ONE make
48+
# argument. The old string accumulation re-split it at every expansion and
49+
# make swallowed the second flag's leading -f as its makefile option.
50+
MAKE_ARGS=()
4751
BUILD_DIR="build/c"
4852
for arg in "$@"; do
4953
case "$arg" in
5054
CC=*|CXX=*) export "${arg}" ;;
5155
--arch|--arch=*) ;; # already handled
5256
arm64|x86_64) ;; # already handled
53-
BUILD_DIR=*) BUILD_DIR="${arg#BUILD_DIR=}"; MAKE_ARGS="$MAKE_ARGS $arg" ;;
54-
*=*) MAKE_ARGS="$MAKE_ARGS $arg" ;; # forward any VAR=VAL to make
57+
BUILD_DIR=*) BUILD_DIR="${arg#BUILD_DIR=}"; MAKE_ARGS+=("$arg") ;;
58+
*=*) MAKE_ARGS+=("$arg") ;; # forward any VAR=VAL to make
5559
esac
5660
done
5761

@@ -92,11 +96,11 @@ BUILD_DIR="$BUILD_DIR" scripts/clean.sh
9296
# the suite set is enumerated from the runner itself and union-guarded, and
9397
# pass/fail/skip totals aggregate to the same numbers as the sequential run).
9498
# CBM_TEST_SEQUENTIAL=1 restores the single-process runner.
95-
make -j"$NPROC" -f Makefile.cbm "$BUILD_DIR/test-runner" $MAKE_ARGS
99+
make -j"$NPROC" -f Makefile.cbm "$BUILD_DIR/test-runner" ${MAKE_ARGS[@]+"${MAKE_ARGS[@]}"}
96100
if [ "${CBM_TEST_SEQUENTIAL:-0}" = "1" ]; then
97-
make -f Makefile.cbm test $MAKE_ARGS
101+
make -f Makefile.cbm test ${MAKE_ARGS[@]+"${MAKE_ARGS[@]}"}
98102
else
99-
make -f Makefile.cbm test-par $MAKE_ARGS
103+
make -f Makefile.cbm test-par ${MAKE_ARGS[@]+"${MAKE_ARGS[@]}"}
100104
fi
101105

102106
# Step 4: C++ large-TU index-hang regression guard (#410). Runs the PROD binary
@@ -111,7 +115,7 @@ fi
111115
# Step 5: Parent-death watchdog regression (#406/#407). Builds the prod stdio
112116
# binary and verifies it self-exits when its launching parent is killed.
113117
echo "=== Step 5: parent-death watchdog regression (#406/#407) ==="
114-
make -j"$NPROC" -f Makefile.cbm cbm $MAKE_ARGS
118+
make -j"$NPROC" -f Makefile.cbm cbm ${MAKE_ARGS[@]+"${MAKE_ARGS[@]}"}
115119
bash "$ROOT/tests/test_parent_watchdog.sh"
116120

117121
# Step 5b: worker-mode parent-death watchdog (#845). A supervised index worker

0 commit comments

Comments
 (0)