Files
metal2vulkan/scripts
Anees Iqbal 1d09ff5d10 scripts: the gate scripts match their lists in the shell, not through a piped grep -q under pipefail
scripts/linux-gate-policy's overlaps() piped printf into `grep -qxF` under `set -euo pipefail`.
bash line-buffers its stdout, so grep can exit at its first match while printf is still writing;
printf then ends with SIGPIPE, pipefail gives the pipeline its status, and a match reads false.
The overlap went unseen and the policy accepted a scratch directory inside the checkout:
linux_gate_policy::a_scratch_directory_may_not_overlap_a_protected_path failed so on a loaded
msi (53490 at b14260ea79) and passed alone (53581). overlaps() now matches the lists with a
`[[ ... == *...* ]]` test. scripts/linux-gate's bsdtar check had the same shape
(`tar --version | grep -q bsdtar`) and is matched the same way.

A new integration test, no_quiet_grep_under_pipefail, reads every script under scripts/ that
sets pipefail and fails on a quiet grep after a single pipe, with a unit test of its detector.
Verified: see the check job named in the landing.
2026-11-19 11:19:24 -08:00
..