diff --git a/tools/stopgap/ygg-verify.sh b/tools/stopgap/ygg-verify.sh index 0b4ee67..372728f 100644 --- a/tools/stopgap/ygg-verify.sh +++ b/tools/stopgap/ygg-verify.sh @@ -46,8 +46,11 @@ # 2026-09-22. Mutation testing uses the ecosystem's tools on a cut's diff. # # TWO RAKES, both paid for on 2026-09-23: -# * The command runs under `bash -o pipefail -c`, and SHELLOPTS=pipefail is exported -# into the container, so a job SCRIPT run as `bash job.sh` inherits pipefail too +# * The command runs under `bash -o pipefail -c`, and BASH_ENV points every child +# bash at a file holding `set -o pipefail`, so a job SCRIPT run as `bash job.sh` +# inherits pipefail too. (Exporting SHELLOPTS did that but also leaked a job's +# `set -u` into bash-wrapped tools: kotlinc died on `JAVA_OPTS: unbound variable`, +# 2026-09-30.) # (the -o flag alone does not reach child shells; Soul proved a failing piped # test in a job script came back exit 0, 2026-09-30). Pipefail forced since # 2026-09-30, after an ack Cut 2 job piped a failing test run into `cut` and @@ -184,10 +187,10 @@ set +e sudo nice -n 10 docker run --rm --name "$cname" --cpus="$cpus" --memory="$mem" \ -v "$work:/src" -v /etc/machine-id:/etc/machine-id:ro \ -v eureka-cargo-registry:/usr/local/cargo/registry -v eureka-nuget:/root/.nuget/packages \ - -e CARGO_TARGET_DIR=/src/target -e SHELLOPTS=pipefail \ + -e CARGO_TARGET_DIR=/src/target -e BASH_ENV=/tmp/.ygg-bash-env \ -e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory -e GIT_CONFIG_VALUE_0='*' \ $docker_args \ - -w /src "$image" bash -o pipefail -c "$cmd" + -w /src "$image" bash -o pipefail -c "printf 'set -o pipefail\n' >/tmp/.ygg-bash-env; $cmd" status=$? set -e pkill -P "$watchdog" 2>/dev/null || true