-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
cmd/pin: Update pinned formula messaging #16301
cmd/pin: Update pinned formula messaging #16301
Conversation
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.
Looks good so far, thanks! My questions are:
- does this indicates if a specific formula has not been upgraded because of the
brew pin
of a dependency? - does
brew upgrade foo
fail/error iffoo
is pinned? - same as 2) but if one of
foo
's dependencies are pinned.
The answer to 1 and 3 is essentially the same. If one of foo's dependencies is pinned and the current version is too old, the install will raise an error in the brew/Library/Homebrew/formula_installer.rb Lines 348 to 352 in ab6a7ed
This error gets caught, printed and then we skip trying to install that formula. That seems to be the case when installing or upgrading formulae so it's even more complex than I originally thought. brew/Library/Homebrew/install.rb Lines 280 to 282 in ab6a7ed
brew/Library/Homebrew/upgrade.rb Lines 110 to 112 in ab6a7ed
No, it would print a warning. This used to be an error message (ofail) and is the message that was brought up in the original issue. That means it won't return a non-zero exit code either anymore. |
The hope is that this will be clearer and less annoying for users. A user came to us a couple weeks ago stating that it was confusing that the `brew upgrade` command printed an error when a pinned formula had a new version available and didn't get upgraded. This PR changes that message to a warning from an error. While looking into this we found that there is another message that gets printed when a package dependency doesn't get upgraded because it is pinned and that got turned into a warning from a normal message. Honestly, that should be more worrying for the user anyway; it could lead to a program not working correctly in the worst case. I also added a message to the `brew pin` command warning about potential unintended behavior if a dependency gets pinned and another package requires a newer version of it. Lastly, I added a commented out deprecation notice for the `brew upgrade --ignore-pinned` command since it's now the default.
bb36203
to
b3a6e59
Compare
Great, 1 and 3 sound right 👍🏻
I feel like |
That sounds reasonable. In that case, should we still deprecate the |
I don't feel strongly either way. |
The idea here is that it should be expected that `brew upgrade` will not upgrade pinned packages but will attempt to upgrade everything else. For that reason, it will only show a warning about pinned packages in that case. If, on the other hand, you pass the name of a pinned package explicitly to the upgrade command, like in `brew upgrade PINNED`, we want to show an error since we cannot upgrade that package until it gets unpinned.
Me thoughts exactly. I'll leave the deprecation in. |
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.
Thanks for all the work here @apainintheneck and sorry for the amount of back and forth needed!
Does feel weird, the one case that comes to mind is that if |
@Moulick I don't believe that was possible before this change either. This strictly changes messaging not how |
Sure, I get that this is just a message change, not arguing that fact at all 😄. From a power users' perspective, looking at the command |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Resolves #16212
The hope is that this will be clearer and less annoying for users.
A user came to us a couple weeks ago stating that it was confusing that the
brew upgrade
command printed an error when a pinned formula had a new version available and didn't get upgraded. Not upgrading a package is the expected result of pinning it.This PR changes that message to a warning from an error. While looking into this we found that there is another message that gets printed when a package dependent doesn't get upgraded because it is pinned and that got turned into a warning from a normal message. Honestly that should be more worrying for the user anyway; it could lead to a program not working correctly in the worst case scenario.
I also added a message to the
brew pin
command warning about potential unintended behavior if a dependency gets pinned and another package requires a newer version of it.Lastly, I added a commented out deprecation notice for the
brew upgrade --ignore-pinned
command since it's now essentially the default.