Repository navigation
fix(build): keep the captured buildctl output in the failed-build error - #68
Conversation
The runner captures the command's combined output, but this call DISCARDED it and wrapped only `exit status 1`. A failed build step therefore left its own error text nowhere: the step log ended at the RUN line and the buildkitd daemon log carried no error either (measured on opencharly/charly#1255, where that hid a pacman failure behind several wrong hypotheses). The error now carries the LAST 60 lines of the captured output — bounded, and the failing step's own line is the one that matters. TestTailLines pins the truncation semantics (empty, short, exact, tail, and that the ERROR line survives), and go build/test/vet pass. Consumer chain: this module is compiled into charly, so a charly dependency bump + release is required before builds on a host use it. *Agent: `image-lane-vram` · Claude Code session `739c9baf-e4cc-465c-9028-0a77b9ea7617`* *Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)*
Review — BLOCKHead SHA: Change class: code (error construction in the Blocks
Non-blocking note
Security screen: PASS (no scope mismatch, no secrets, no guardrail/supply-chain change). Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The review was right: TestTailLines exercised the helper and would stay green if the call site stopped using it. The error construction is now buildFailure(), the ONE place a failed build's error is built, used by the call site and asserted by TestBuildFailure_CarriesTheCapturedOutput (the failing step's own output is in the error; empty output leaves no dangling newline). *Agent: `image-lane-vram` · Claude Code session `739c9baf-e4cc-465c-9028-0a77b9ea7617`* *Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)*
|
STATUS — round 2 ( RCA (R1 — the missed control)The review's block 1 is the trap this session has hit before, and it names it exactly: Compliance additions
Agent: |
Review — BLOCKHead SHA: Change class: code (error construction in the Blocks
Non-blocking note
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…helper The review was right twice: buildFailure being tested proves nothing about the line that CAPTURES out. The build call is now the method runBuildctl (capture -> buildFailure), and TestRunBuildctl_PutsTheCapturedOutputInTheError injects a runner that fails only buildctl and asserts the returned error carries the step's own output. Reverting that method to `if _, err := runner.Run(...)` fails this test while the helper tests stay green. Also: the cap is the named constant tailLineCount (R3 note). *Agent: `image-lane-vram` · Claude Code session `739c9baf-e4cc-465c-9028-0a77b9ea7617`* *Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)*
|
STATUS — round 3 ( What changedThe build call is the method
RCA (R1, the missed control, twice)I twice claimed coverage that did not cover the defect: first a helper test, then a second helper ( RetractionThe earlier STATUS said "the missing coverage exists". That was false for the call site; it is corrected in the body and here. A1
Agent: |
Review — PASSHead SHA: Security screen: PASS — no scope mismatch, secrets, guardrail/supply-chain change. Placement CORRECT (fix lives in Comment dispositions:
Non-blocking note: the injected runner's Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
… its output (#1257) * chore(deps): adopt plugin-build v0.2026328.1 — a failed build carries its output opencharly/plugin-build#68 merged as v2026.328.0001 (module v0.2026328.1): the build error now carries the last 60 lines of buildctl's captured output, so a failing step's own ERROR line reaches the log instead of being discarded with `exit status 1`. That is the precondition for #1255: once a charly release carries this, a failing build on this host prints the pacman error that has been invisible, and the base/build defects behind pod-cdi#14 and the pod-comfyui beds can be diagnosed from the artifact. go build ./... and go vet ./... pass at the bump; the module's own tests passed in #68. *Agent: `image-lane-vram` · Claude Code session `739c9baf-e4cc-465c-9028-0a77b9ea7617`* *Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)* * chore(mods): align every lockstep module to the bumped shared pins The sdk require this change adopts (v0.2026327.1021) is a SHARED pin: the core module anchors it and every lockstep tools module must carry the same version, which `tools/gomod-canonical`'s TestContractPinsMatchShared enforces in CI. The bump moved core's anchor and left three tool modules behind, so the `go` job went red on the previous head. `charly task mods-tidy` is the sanctioned verb for exactly this (the control's own message names it); it adopts the shared pins and tidies every lockstep module. The result is six files — go.mod and go.sum in generate-packages, golden-cloudinit and golden-compile — and the control is green: $ cd tools/gomod-canonical && GOWORK=off go test -count=1 ./... ok github.com/opencharly/charly/tools/gomod-canonical 0.003s *Agent: `image-lane-vram` · Claude Code session `739c9baf-e4cc-465c-9028-0a77b9ea7617`* *Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)*
Summary
A failed build no longer discards its own diagnostics.
buildkitdrive.ExecRunner.Runcapturesbuildctl's combined stdout+stderr — and this call threw it away, wrapping onlyexit status 1:Why it matters (measured). opencharly/charly#1255: a
pacmanstep in a base-stageRUNfailed, the step log ended at theRUNline, and the buildkitd daemon log carried no error either — because the only artifact that ever held the text was the in-memoryoutthis line dropped. Six checks were spent disproving hypotheses (--progress plainalready explicit; daemon log clean; mirrors reachable; no staledb.lck) before the discard was found by reading this file. The same discard hides every future build failure in this repo's path.tailLineskeeps the last 60 lines — the failing step's own line, not the leading progress — and never emits a trailing newline.How tested
TestTailLinespins the truncation semantics;TestBuildFailure_CarriesTheCapturedOutputasserts the error carries the step's line and leaves no trailing newline on empty output; and — the review's actual requirement, which I missed twice —TestRunBuildctl_PutsTheCapturedOutputInTheErrorexercises the CALL SITE: the build call is the methodrunBuildctl(capture →buildFailure), and a runner that fails onlybuildctlis injected, with the returned error asserted to contain the captured#12 ERROR: …line. Reverting the method toif _, err := runner.Run(...)fails that test while the helper tests stay green.What is not proven here: the error appearing in a real build. This module is compiled into charly, so a charly dependency bump and release must land before a host build uses it; the live proof is the next build after that, which should print the pacman error that #1255 is about. The commit is therefore
analysed on a live system, notfully tested and validated.Rulebook compliance
TestTailLines), and the changed path is a function whose behaviour is directly asserted./charly-internals:goand/charly-internals:git-workflow(loaded earlier in this session); the change is a library error path, no CUE or schema surface.git statuswas checked before the operations; no destructive action, no force-push, no bypass. (A first push failed because the commit sat on a detached HEAD in the submodule checkout — my process error, recorded, fixed by creating the branch at the commit.)buildFailure/tailLines/runBuildctlare new and additive.Change classification
Change class: code (error construction in the build driver) → gate:
go build/go vet/go testhere; the live build follows the charly release.Breaking change + rollback: none — the error string gains a bounded tail of output; exit codes and control flow are unchanged. Rollback reverts the file.
Filed issues
Agent:
image-lane-vram· Claude Code session739c9baf-e4cc-465c-9028-0a77b9ea7617Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)