-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[BUG] brew upgrade
will build formula as the bottle when the bottle is not available
#6063
Comments
This logic seems to go back to the very beginning of this code. |
cc @MikeMcQuaid |
FYI, the logic in b6cca78 is actually correct. Noted that it excludes the case when current installation is poured from bottle. |
Edit: it's fine here. def build_bottle?
built_as_bottle && !poured_from_bottle
end |
The bug may have been introduced in 820b634, where |
I'm having trouble replicating the behaviour that you're experiencing though. Here's what I did: brew install hello
brew edit hello
# Add revision 1
# Delete the bottles
# Add def post_install; ohai "Postinstall!"; end
brew upgrade hello I see that postinstall is run.
|
I don’t have access to my Mac for now. But on Linuxbrew, I get the following. Noted that you may need to delete bottles for all platforms (which is what happens for
|
Ah, yep. Deleting the entire bottle section does produce the behaviour that you describe.
|
I think 820b634 is indeed the culprit. I think I made the mistake to assume |
Agreed. Perhaps past tense? |
And I think |
brew
command and reproduced the problem with multiple formulae? If it's a problem with a single, official formula (not cask) please file this issue at Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues/new/choose. If it's abrew cask
problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew config
andbrew doctor
and included their output with your issue?In the following situation,
brew upgrade
would try to build the formula as bottle (i.e., not runningbrew postinstall
):I find this when I try to upgrade
gcc@8
.The root cause is due to the following codes.
brew/Library/Homebrew/cmd/upgrade.rb
Line 167 in 01ebe91
Noted
f.bottle_defined?
is false when the bottle is not available yet andf.build.bottle?
is true since the formula is previously poured from the bottle.There seems to be a discrepancy between whether a formula is built from bottle as it is or it is poured from the bottle. Also why do we need to support upgrade from a bottle build to another bottle build. Can we change the above code to just:
/cc @sjackman
The text was updated successfully, but these errors were encountered: