From 297fabbe42beee7ff3e98d6d32c55bfb49f03fa0 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 20 Aug 2026 22:51:47 +0000 Subject: [PATCH] ci: stop the clang-format report dying on SIGPIPE for large diffs The informational clang-format job still went red on any PR whose diff exceeded the 64 KiB pipe buffer. Under `set -euo pipefail`, `printf ... | head -n 400` makes printf take SIGPIPE once head closes, pipefail propagates 141, and set -e kills the step before its `exit 0`. Reproduced: a 40,000-line payload exits 141; 5,000 lines (under the pipe buffer) exits 0 -- which is why the one-file verification PR passed and PR #147, with 12 files, did not. This is the same shape as #89: a set -e interaction with a pipeline that was never exercised at scale. sed reads all of its input, so it cannot signal printf. --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93f16b4..a160f03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -343,7 +343,11 @@ jobs: # full. max=400 total=$(printf '%s\n' "$out" | wc -l | tr -d ' ') - shown=$(printf '%s\n' "$out" | head -n "$max") + # NB: `| head` would make printf take SIGPIPE once the diff exceeds the + # 64 KiB pipe buffer; under `set -euo pipefail` that is exit 141 and + # kills the step before the `exit 0` below -- the same class of bug as + # #89, and invisible on a small diff. `sed` reads all of its input. + shown=$(printf '%s\n' "$out" | sed -n "1,${max}p") { echo "### clang-format (informational)"