upgrade: auto-tap formulae or casks before upgrading#21866
upgrade: auto-tap formulae or casks before upgrading#21866gibfahn wants to merge 1 commit intoHomebrew:mainfrom
Conversation
MikeMcQuaid
left a comment
There was a problem hiding this comment.
I don't think this makes sense as-is.
brew upgrade a/b/c doesn't really make sense if a/b is untapped as a/b/c wouldn't be installed.
If it's for dependencies specifically: that should be handled differently.
bd8235d to
5d89f21
Compare
|
🤦 I forgot I had to fix this. Will add some tests and check that it works properly, sorry for the noise. |
When you `brew install org/tap/formula-name`, it automatically taps the repo if not present. Mirror this behaviour in `brew upgrade` so that specifying a tap-prefixed name works the same way. The use-case here is a formula adding a `depends_on my-org/my-tap/my-formula` line. This will work fine for people who `brew install` the formula fresh, but not for people who `brew upgrade` an existing formula.
5d89f21 to
3c76a93
Compare
|
@gibfahn before pushing more: let's talk about the actual behaviour. As-is: I don't agree with this. The trust model for taps is such that they should be installed when explicitly requested by the user. If any tap can trigger any installation of another tap: that is bad. If |
Fair enough, I didn't realise the
Yeah it does
Happy to talk, but not having this makes having dependencies on other taps a pain. I know this isn't a problem for homebrew-core, but third-party taps are a valid use-case right? Let's say you have: # my-org/tap/my-formula
depends_on "other-org/tap/my-dependency"Then when the person writing the formula tests it locally it will work, but when they run it remotely it won't because the other tap hasn't been tapped. Maybe brew should have a flag or should prompt to install the tap instead? |
Yeh, I think it should error out and tell you to tap the tap rather than doing so automatically for |
brew lgtm(style, typechecking and tests) with your changes locally?When you
brew install org/tap/formula-name, it automatically taps therepo if not present. Mirror this behaviour in
brew upgradeso thatspecifying a tap-prefixed name works the same way.
The use-case here is a formula adding a
depends_on my-org/my-tap/my-formulaline. This will work fine for people whobrew installthe formula fresh, but not for people whobrew upgradeanexisting formula.
I made a similar change for
brew bundle installin 451eda1