-
Notifications
You must be signed in to change notification settings - Fork 5.7k
fix(progress): restore TTY output on Windows consoles #13576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(progress): restore TTY output on Windows consoles #13576
Conversation
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
ndeloof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you think this _console wrapper was introduced for a reason?
|
you r right @ndeloof , i looked into history (commit bf50c99 by u) and looks like _console acts as an adapter to force BuildKit to treat the output as a containerd.Console, which enables the ANSI progress bars and colors. but here is the twist, as this works great on linux and mac, but on windows this wrapper seems to interfere with how the console handle is passed down, causing the TTY output to disappear/break. since we don't want to lose progress bars on linux and mac, I suggest to modify makeConsole to strictly return the original out on windows, while keeping the wrapper for everyone else. do you understand @maishivamhoo123 |
amyssnippet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should be the logic
Yes @amyssnippet Sir , understood. I have updated the code as suggested. Thank you sir. |
|
look @maishivamhoo123 we are here to fix bugs which lie under the hood, what i suggested was just a workaround. rn as @ndeloof suggested, that this should work on every os, and we should consider on fixing it under the hood of buildkit tht why it fails. we should fix that. we should look at how _console implements Fd(). On Windows, we might need to ensure the wrapper creates a bridge to the underlying file handle correctly so isTerminal checks pass. Can you check how streams.Out implements FD() vs how our wrapper passes it through? We might need a Windows-specific implementation of the wrapper that exposes the handle correctly. |
|
and also make sure to do a signoff commit |
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
bdc17e4 to
9d53f92
Compare
amyssnippet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still just a workaround, we have to dig deeper into buildkit and docker cli, they are different maintained projects in the docker and containerd ecosystem.
| // streams.Out wraps the actual file. We attempt to unwrap it. | ||
| return os.NewFile(c.Out.FD(), "compose") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could lead to resource leaks or unexpected behavior if the file descriptor is closed prematurely. The comment acknowledges the wrapping, but this assumes streams.Out.FD() always points to a valid console file.
|
tl;dr: dont just on any possible feature request to prove your AI agent can deal with compose codebase, as this can never get implemented in the compose repo. Better confirm with maintainers like @ndeloof which one deserve some time for investigation and design discussions in issue which posted this #13570 |
Description
Fixes a regression where TTY progress output (colors/bars) was lost on Windows consoles.
The issue was caused by [explain why the console detection failed].
Related Issue
Fixes #13570
Type of change
Testing
docker compose up --build