From dded3703ee2b02e0d1b872669e5d0e91bbedb055 Mon Sep 17 00:00:00 2001 From: Georgios Jason Efstathiou Date: Wed, 3 Jun 2026 17:53:41 +0200 Subject: [PATCH] Annotate the test-e2e-docker bash 3.2 array guard Add quick explainer for odd bash 3.2 workaround in docker harness. --- scripts/test-e2e-docker | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/test-e2e-docker b/scripts/test-e2e-docker index e8c695302..8c974471b 100755 --- a/scripts/test-e2e-docker +++ b/scripts/test-e2e-docker @@ -44,8 +44,11 @@ fi # SKIP_SETUP (no value) forwards the host's value through, mirroring the # native runner's fast-iteration flag. -# `${EXTRA_ENV[@]+...}` guards against `set -u` erroring on the empty array -# (non-local runs) under bash 3.2, which ships on macOS. +# Expanding an empty array as "${EXTRA_ENV[@]}" under `set -u` aborts with +# "unbound variable" on bash < 4.4; macOS still ships bash 3.2, so we can't +# rely on the 4.4 fix. ${arr[@]+...} expands to nothing when the array is +# empty and to the quoted elements otherwise — a no-op on bash >= 4.4, so it +# stays correct on modern shells. See https://stackoverflow.com/q/7577052 exec $COMPOSE run --rm \ -e HOST_UID="$(id -u)" -e HOST_GID="$(id -g)" \ -e SKIP_SETUP \