Skip to content

fix(build): don't fail bake progress when stdout is not a console - #14184

Closed
locker95 wants to merge 1 commit into
docker:mainfrom
locker95:fix/build-console-redirect
Closed

fix(build): don't fail bake progress when stdout is not a console#14184
locker95 wants to merge 1 commit into
docker:mainfrom
locker95:fix/build-console-redirect

Conversation

@locker95

@locker95 locker95 commented Sep 5, 2026

Copy link
Copy Markdown

#14090 unwraps the real stdout file so Windows TTY progress works. that also feeds a redirected stdout (compose build >/dev/null) into ConsoleFromFile, which then dies with provided file is not a console.

only unwrap when stdout actually is a terminal, and fall back to plain progress otherwise.

Fixes #14182

docker#14090 hands the real stdout file to buildkit so Windows TTY progress
works. that also passes a redirected stdout (`build >/dev/null`) into
ConsoleFromFile, which errors with "provided file is not a console".

only unwrap a terminal file, and fall back to plain progress otherwise.

Fixes docker#14182

Signed-off-by: Dean Chen <862469039@qq.com>
@ndeloof

ndeloof commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for digging into #14182 — the analysis of the failure is right, but the fix lands in the wrong place, so we'll go with an alternative.

The root cause is a mode/stream mismatch: display.Mode resolves auto against stderr (deliberately — Compose's own progress renders there, and probing stdout would force plain on up | tee), while bake's display writes to stdout. compose build >/dev/null therefore hands bake a tty mode computed for a stream it doesn't write to.

Patching it in build_bake has two problems:

  • newBakeDisplay silently downgrades an explicit --progress=tty to plain when stdout is not a console, where buildx bake (and compose's own --progress tty handling) fails loudly — auto should degrade, an explicit tty request should error.
  • the makeConsole change is redundant with that fallback (progressui already falls back to plain in auto mode when the stream is not a console), and its second IsTerminal branch is unreachable in practice.

#14194 fixes the root cause instead: pass the unresolved auto to bake unless the user explicitly asked for tty, and let buildkit's progressui probe the actual output stream. That also revives the BUILDKIT_PROGRESS override, which could no longer trigger.

Closing in favor of #14194 — thanks again for the report and the repro.

@ndeloof ndeloof closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] failed to get console: provided file is not a console

2 participants