-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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/info: only display keg info if tap matches #19295
Conversation
Fixes #19294.
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.
Seems fine though do we want to handle the case where a tab tap is nil
any differently?
Thank you, this resolves the core bug. I am curious on the overall expected use of homebrew with taps, however. The recent trajectory of homebrew has been to promote more third party taps and less in core. (Removing build options and whatnot such that homebrew core is the 80% happy path, and pushing customization into taps.) However, the overall use of homebrew does not make taps a "friendly" experience. To wit:
Will not give desired results. While this PR fixes the core bug (brew-info providing false information), it doesn't improve the overall cohesive use of brew with the ever-growing-presence of 3rd party taps. |
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 think this should probably be reverted. We don't have many(/any?) other commands where we require fully scoping formulae from taps like this. Instead it feels like we should use the actual formula from the tap if the opt-linked keg is from that tap.
Thoughts?
@MikeMcQuaid I think agree. And that would also improve the cohesiveness issue I commented above. If I have (tap) formula X installed, and I say The downside, then, is that |
FYI We're seeing this change break some of our internal tooling that uses We should be able to work around it, but I suspect this is a breaking change that may affect many others. |
@jrobotham-square I'm curious how your scripts have been detecting whether the tool that's installed is from core or your tap? (That was the bug this originally attempted to address.) |
For scripts you should be using A possible solution here is to:
I think that covers all cases? |
Short answer - I don't think our internal tooling was actually doing this properly and we've probably just been lucky it hasn't bitten us earlier. (it's some tooling our team has inherited)
Yeah - makes sense - being coupled to the FWIW Our script currently has a mix of fully qualified references and short names. I think we've been relying on this bug for it to work up until now. |
This seems ideal for now. Reverting this until then in #19324 until then.
I disagree with this statement.
The only real "fix" here is something we've recommended for a long time but should consider adding more warnings and/or documentation for: using the same names as homebrew/core formulae in taps is simply a bad idea with a lot of rough edges, some of which we can improve, some we cannot. |
👍 Is there an issue already in place to capture the future state? (I searched but didn't find one) I can open a new one, or reopen #19294 (which is again an issue with the above PR reverted)
I should have couched this in more equivocating terms. I didn't mean to speak for homebrew team. This was the inference I took from a lot of gh issues being closed with, effectively, "make or use a tap". My only reason to mention this: it is my understanding that taps are still an expected and supported mechanism for distributing tools that don't receive broad community use. And that third party taps aren't being deprecated or discouraged as a feature. (If they are, then homebrew would have little incentive to ensure core commands and features continue to play well with taps.)
Understood. Though it's worth mentioning that in this case, the git-sync formula in the tap was created over a year before the conflicting one was added to core. (git-sync added to https://github.com/jacobwgillespie/homebrew-tap in June 2021; kubernetes' git-sync added to core in Aug 2022). It doesn't make sense for third party taps to squat on formula names; so I'm not suggesting that the tap should or could have reserved "git-sync" for itself. However, I think it is worth recognizing that if name conflicts between core and taps cause such issues, we shouldn't assume that the core formula came first. In such cases as this, the tap formula existed first and was working fine. (Indeed, it was following the recommended practice of choosing a unique name that did not conflict with core.) And then through no fault of and no change by the tap, suddenly it was in conflict with one from core and causing issues. That implies that the addition of new formula in core can effectively break existing workflows (brew commands and scripts using them) involving taps. That seems problematic. |
We shouldn't but tap providers should consider if it's worthwhile continuing to maintain something that homebrew/core does with the same name, particularly given the previously stated issues.
This is the nature of a relatively fast-moving rolling release package manager like Homebrew. See also: we deprecate things and these also require changes from taps to maintain identical end-user behaviour
Break? No, I don't think so. Cause suboptimal workflows/output? Yes. Given how taps and kegs are implemented: I don't really see any solution to this requiring a huge migration for all taps when seems much worse than the status-quo. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Fixes #19294.