services/system: print warnings to stderr instead of stdout#21837
Merged
carlocab merged 1 commit intoHomebrew:mainfrom Mar 26, 2026
Merged
services/system: print warnings to stderr instead of stdout#21837carlocab merged 1 commit intoHomebrew:mainfrom
carlocab merged 1 commit intoHomebrew:mainfrom
Conversation
Contributor
Author
|
cc @carlocab |
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts brew services domain-selection messaging so warnings/hints don’t pollute machine-readable stdout (e.g., --json output), addressing downstream JSON parsing failures (notably when invoked via sudo in nix-darwin/Homebrew Bundle flows).
Changes:
- Replace two
putshint lines withopooso they emit on stderr instead of stdout. - Keep the “hide warning/hints” guidance gated behind
HOMEBREW_NO_ENV_HINTS.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Thanks; I think at least the first, if not both, copilot review comments need addressing. |
Contributor
Author
|
thanks for getting back so quickly! i've addressed the first one but i'm not very familiar with the code base so i'm not sure how to get started on the second one maybe that could be done in another pr by someone else? |
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.
brew lgtm(style, typechecking and tests) with your changes locally?in #21830
ac06ea7 seem to break my nix-darwin configuration as nix-darwin is executing the bundle command with root
https://github.com/nix-darwin/nix-darwin/blob/da529ac9e46f25ed5616fd634079a5f3c579135f/modules/homebrew.nix#L951
thus these two warning prints lines to stdout mess with json parsing
brew/Library/Homebrew/services/system.rb
Line 101 in 86fe878
and im getting confusing errors like this:
this can be reproduced with (remember to change the username, and e> syntax is for nushell only)