-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Update brew list command to remove deprecation warning #4995
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
Update brew list command to remove deprecation warning #4995
Conversation
Homebrew has begun emitting a deprecation warning when checking for requirements on osx as of Homebrew/brew#8851 Example output when installing a Ruby: ``` rvm install 2.7.2 Searching for binary rubies, this might take some time. No binary rubies available for: osx/10.15/x86_64/ruby-2.7.2. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for osx. Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead. ... (repeated ~12 times on my system) Warning: Calling `brew list` to only list formulae is deprecated! Use `brew list --formula` instead. Certificates bundle '/usr/local/etc/[email protected]/cert.pem' is already up to date. Requirements installation successful. ... ``` This does not impact the execution, and the command completes successfully, however it's extra noise for the end user. The `--formula` flag was added back in August in Homebrew/brew#8229 and brew will auto-update in most scenarios - but users who have set the environment variable to not auto-update brew may fail this command with: Error: ambiguous option: --formula I do not have any insight when brew may handle the deprecation warning and remove the existing behavior. Signed-off-by: Mike Fiedler <[email protected]>
Signed-off-by: Mike Fiedler <[email protected]>
|
I've added an entry to the CHANGELOG.md - but am uncertain how to interpret the other messages from the Mergable bot - so would appreciate any pointers you may have. |
I added a Label and Milestone for Mergeable. Any idea how old the Thanks for the PR! |
Thanks - I called that out in the PR description:
|
|
The brew commit that added the deprecation warning is Homebrew/brew@c8809ce. I don't think it makes sense, to document something as the default behavior and then throw a deprecation warning if you actually do depend on that default, which I've mentioned to @Akylzhan in a comment to the commit. Added to that this breaks backwards compatibility, which makes the change even worse. |
cmd/list.rb: --formula, --cask as default TTY: cmd/list.rb: proper deprecated message on non TTY outputs update manpage update zsh completion updated manpages/brew.1 update tests return list_casks list_spec.rb: not output to stderr
Mergeable fixed |
Maybe we should check |
In the event the user has a version of homebrew older than 2.5.7, when the `--formula` flag was introduced, allow the command to continue. Signed-off-by: Mike Fiedler <[email protected]>
…com/miketheman/rvm into miketheman/update-brew-list-command
I took a look at this, and added a detection mechanism. I'm not certain of the idioms used in the codebase, but this seemed to match similar cases of version comparison. |
| \typeset brew_lib_prefix | ||
| brew list -1 | __rvm_grep "^${1}$" >/dev/null && | ||
| # Test for older versions of Homebrew before adding the `--formula` flag. | ||
| brew_version=$( brew --version | tee | head -n 1 | sed 's/[^0-9.]*\([0-9.]*\).*/\1/' ) |
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.
tee was necessary to prevent a broken pipe, since the brew command will return one line before proceeding to check other versions of casks. If there's a preferred way of doing this, happy to adapt.
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 know the PR is merged, but if you can use AWK it gets cleaner:
brew --version | awk 'NR==1 { print $2 }'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.
Do you wanna fire up PR with this change?
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.
Sure thing! I wasn't sure if it was a change worth enough to open a PR, but I'll make one now :)
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.
Does not hurt for sure :) Thanks!
pkuczynski
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.
LGTM!
Homebrew has begun emitting a deprecation warning when checking for
requirements on osx as of Homebrew/brew#8851
Example output when installing a Ruby:
This does not impact the execution, and the command completes
successfully, however it's extra noise for the end user.
The
--formulaflag was added back in August in Homebrew/brew#8229and brew will auto-update in most scenarios - but users who have set the
environment variable to not auto-update brew may fail this command with:
I do not have any insight when brew may handle the deprecation warning
and remove the existing behavior.
Fixes #5007