"brew upgrade" forgets build options #11171
Comments
(a) Is the |
The mtr keg is still linked: $ which mtr |
I just tried to reproduce this by faking an mtr 0.80 keg with an install receipt and it works as advertised. Homebrew uses the symlink in Library/LinkedKegs to find the install receipt, so if that symlink is missing or broken it won't be able to find the install options. I would try unlinking and relinking the mtr keg. |
$ brew unlink mtr $ brew link mtr $ brew upgrade mtr So it's still trying to install all these packages as dependencies of mtr. |
Hmm. Upon closer inspection, this is a symptom of the larger problem of declaring dependencies conditionally (specifically, conditionally on the contents of ARGV). There doesn't appear to be any problem retrieving the install options from the receipt. In fact, I think that even after the upgrade installs all of the gtk deps, the new install receipt would still say that When invoking Unfortunately there is not a quick fix for this, but there are several issues open pertaining to deps being declared conditionally and how we can avoid that, reworking install options, etc. (As a side note, do people usually install mtr with |
Ok, so there's no way to use the "upgrade" command for this. I guess I'll just unlink, install the new version, link and clean up for now :( |
Many formulas add dependencies conditionally based on the presence of some options in ARGV. These options are saved in the tab file, but they are not present in ARGV when brew upgrade is called. As a result, upgraded formulas are installed with the wrong dependencies. This patch solves the problem by letting formulas see the expected ARGV while upgrading. In the long term, it would be better to remove all uses of ARGV from formulas in favor of some options-based interface, but this bug does not have to wait until a new design is finalized. Fixes Homebrew#11171
@jacknagel what do you think of the solution I posted? (I'm pinging you because I'm not sure if people get notified when issues are referenced from other issues) |
This should be addressed by the work in #13923. |
$ brew -v
0.9
When I run "brew upgrade mtr", brew doesn't recognise that I had previously built mtr with "--no-gtk", and tries to install all kinds of dependencies.
The text was updated successfully, but these errors were encountered: