Repository navigation
fix(build): hand unresolved 'auto' progress mode to bake - #14194
Conversation
display.Mode resolves "auto" against stderr β the stream Compose's own progress renders to β so `compose build >/dev/null` in an interactive terminal resolves to "tty". Bake reuses that mode for a display writing to stdout, and buildkit's progressui hard-fails in tty mode when the stream is not a console. Pass the unresolved "auto" to bake unless the user explicitly asked for tty: progressui then probes the actual output stream and degrades to plain by itself when stdout is redirected. An explicit --progress=tty keeps failing loudly on a non-terminal, as `buildx bake` does. This also revives the BUILDKIT_PROGRESS override in doBuildBake, which only applies to AutoMode and could no longer trigger. Fixes docker#14182 Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: π’ APPROVE
The fix is correct and well-targeted. display.Mode is resolved against stderr by selectEventProcessor; by passing the unresolved auto back to bake when tty was auto-selected (not user-forced), buildkit's progressui probes the actual stdout stream independently β fixing the hard-fail when stdout is redirected. Explicit --progress=tty is preserved and still fails loudly on a non-terminal, consistent with buildx bake.
The new test correctly exercises all the relevant cases: autoβttyβauto round-trip, explicit tty pass-through, plain/quiet/json pass-through, and jsonβrawjson mapping. The global-mutation-plus-Cleanup pattern matches the pre-existing convention in compose_progress_test.go.
Codecov Reportβ All modified and coverable lines are covered by tests. π’ Thoughts on this report? Let us know! |
display.Mode resolves
autoagainst stderr β the stream Compose's own progress renders to β socompose build >/dev/nullin an interactive terminal resolves totty. Bake reuses that mode for a display writing to stdout, and buildkit's progressui hard-fails in tty mode when the stream is not a console.Pass the unresolved
autoto bake unless the user explicitly asked for tty: progressui then probes the actual output stream and degrades to plain by itself when stdout is redirected. An explicit--progress=ttykeeps failing loudly on a non-terminal, matchingbuildx bake. This also revives theBUILDKIT_PROGRESSoverride indoBuildBake, which only applies to auto mode and could no longer trigger.Alternative to #14184, addressing the root cause upstream of
build_bake.Fixes #14182
π€ Generated with Claude Code