libmain: fix ignoring empty lines in the print-build-logs option#12133
libmain: fix ignoring empty lines in the print-build-logs option#12133mergify[bot] merged 1 commit intoNixOS:masterfrom
Conversation
|
https://discourse.nixos.org/t/2024-12-04-nix-team-meeting-minutes-200/57005 In our nix meeting we decided that it should not print repeated empty lines. A single empty line is fine. |
Please let me check just to be sure. |
|
@momeemt So just now it emits no empty newline and we would be ok with emitting one empty newline and than discarding the rest. Unless we have a real good use case for multiple new lines, we think just having one empty newline makes logs more readable. |
roberth
left a comment
There was a problem hiding this comment.
Did we consider that silently omitting newlines could still be surprising to users?
It'd still be unexpected, but also a more complex behavior that's harder to "figure out by accident".
I think Nix should log something like <multiple newlines omitted> in ASCII faint color.
Nonetheless, this is already an improvement as is.
|
I guess you are right. Our proposal would be just an optimization to that. |
|
@Mergifyio queue |
✅ The pull request has been merged automaticallyDetailsThe pull request has been merged automatically at bcb92a5 |
Closes: #11991
Motivation
The logger previously ignored empty lines in the print-build-logs option.
Running the following nix file with this option shows that empty lines are not printed in the log, even though the build script prints them.
I fixed the problem by removing
!lastLine.empty(), so it now outputs like this.Context
This problem was reported by #11991.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.