Name the end of the pipeline that actually broke - #176
Merged
Conversation
Windows failed twice this month at the same line, and both logs said the
same thing:
bin/makepkg.conf: Write error: Broken pipe
That is bsdtar, naming whatever file it happened to be reading when its
output closed. The file was fine. What broke was the other end -- most
likely xz, killed for memory during a silent three-minute -9 over the
core payload -- and a process the kernel kills leaves no message at all,
so nothing in the log was about it.
Under pipefail the failing status does surface; the text does not,
because it belongs to whichever element noticed first, and that is never
the one that died. So both compression pipelines now capture PIPESTATUS
and report every element that failed, by name, and a status above 128 as
the signal it is. The status the caller sees is unchanged: report_pipeline
returns the last failing one, which is what pipefail would have given it.
Simulated by putting an xz on PATH that dies mid-write, against
tests/package/test-core-package.sh:
before : Write error (and a job-control dump)
after packaging vdpm-…pkg.tar.xz: bsdtar exited 1
packaging vdpm-…pkg.tar.xz: xz killed by signal 9
both exiting 137.
tests/ci/test-pipeline-report.sh drives the function the script defines,
not a copy: silence when nothing failed, the killed compressor with its
signal, the upstream SIGPIPE reported too, an ordinary exit as an exit,
an element past the names given, and the status preserved.
frangarcj
force-pushed
the
next-pipeline-blame
branch
from
August 28, 2026 10:43
9a738f3 to
9bfacbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows failed twice this month at the same line of
create-core-package.sh, and both logs said the same thing:That is bsdtar, naming whatever file it happened to be reading when its output closed. The file was fine. What broke was the other end — most likely
xz, killed for memory during a silent three-minute-9over the core payload — and a process the kernel kills leaves no message at all, so nothing in the log was ever about it.Under
pipefailthe failing status surfaces. The text does not: it belongs to whichever element noticed first, and that is never the one that died.What changes
Both compression pipelines — the
.MTREEone throughgzipand the package one throughxz— capturePIPESTATUSand hand it toreport_pipeline, which names every element that failed and reads a status above 128 as the signal it is.The status the caller sees is unchanged.
report_pipelinereturns the last failing one, which is exactly whatpipefailwould have handed up, so anything reading 137 out of this keeps reading 137. It says more, not something else.Simulated
An
xzonPATHthat dies mid-write, againsttests/package/test-core-package.shinubuntu:24.04:master: Write error, plus a job-control dumppackaging vdpm-…pkg.tar.xz: bsdtar exited 1packaging vdpm-…pkg.tar.xz: xz killed by signal 9The first poison I wrote drained its input before dying, which let bsdtar finish and produced a different signature — worth saying, because the faithful one has to die while bsdtar is still writing, which is what an OOM kill does.
Test
tests/ci/test-pipeline-report.shdrives the function the script defines, extracted withsedthe waytest-host-runner.shalready does, rather than a copy of it:SIGPIPE→ reported too, so the consequence is visible alongside the causeOne thing worth noting
tests/ci/test-empty-array-expansion.shcaught this change before it ran anywhere:PIPESTATUSis never empty after a pipeline, so this would not have failed in practice — but the rule was made mechanical on purpose after #168, and the guard doing its job on new code is the point of it. Fixed rather than exempted.All 10 CI tests pass;
tests/package/test-bootstrap-archive.shand the packaging half oftest-core-package.shpass in a Linux container (its pacman step needs a docker this one does not have).AI tools were used in preparing this PR (Claude Opus 5, Anthropic).