Fix doubled newlines and blank separators in build logs - #725
Open
bschwedler wants to merge 3 commits into
Open
Conversation
PrefixedLogSink.write() printed streamed build-output lines verbatim through Rich's Console.print(), which appends its own trailing newline. Lines from python_on_whales's stream_logs come from pipe.readline(), which keeps the original line terminator, so every line of `bakery build --strategy build` output was followed by a blank line. Strip the trailing \r\n before assembling the prefixed line so Console.print supplies exactly one newline per line.
buildx's plain progress output uses bare blank lines to separate build steps. After stripping trailing newlines, those became lines containing only the `[key]` prefix and no content -- clutter rather than useful separation once every other line is already tagged with its key. Skip printing when a line is empty (or whitespace-only) after the newline strip, instead of printing a bare `[key]`.
The prior wording framed the drop as targeting "buildx's own step separators," implying the code can tell a buildx separator apart from any other blank line. It can't -- write() drops every blank line unconditionally, regardless of source (e.g. a RUN command's own blank stdout output would be dropped the same way). Reworded to say what the code actually does.
ianpittwood
approved these changes
Aug 11, 2026
ianpittwood
left a comment
Contributor
There was a problem hiding this comment.
Manually tested, great fix!
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 12, 2026
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.
PrefixedLogSink.write()doubled every line's newline and printed buildx's blank separator lines as bare[key]tags.Strips the line's own trailing terminator before printing and drops blank lines outright.
Closes #724