-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Skip build deps to avoid downloading bottles #13065
Conversation
Dependency.to_formula() in the following line will cause a CoreTapFormulaUnavailableError then download all dependency bottles in FormulaInstaller.verfi_deps_exist()
# avoid downloading build dependency bottles | ||
next if dep.build? && dependent.pour_bottle? && Homebrew::EnvConfig.install_from_api? |
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 odd to me that it only happens in the fetch stage and only for API installs. Something must be done differently somewhere for this inconsistency to exist.
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 the correct fix should be creating the Formula
object from json directly instead of from the downloaded bottle file IIUC, but that needs more work as the formula json API doesn't have any Linux dependencies.
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.
Ah so #12936 basically.
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.
Yeah, exactly. Should I remove the first commit or close this pull request?
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.
You could cherry-pick #12936 into this PR and address the feedback from there here?
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'm fine with at least the second commit as a short-term fix - it's consistent to what we have elsewhere.
I wouldn't object to the first commit - but I feel like there's something wrong elsewhere if it doesn't happen at install time and only at fetch time.
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.
dependent.deps
at here contains all the dependencies including build dependencies, this happens also when core tap is cloned
brew/Library/Homebrew/dependency.rb
Line 101 in b533b38
def expand(dependent, deps = dependent.deps, cache_key: nil, ignore_missing: false, &block) |
then at this line to_formula
will cause an error
brew/Library/Homebrew/dependency.rb
Line 128 in b533b38
expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, ignore_missing: ignore_missing, &block)) |
then start downloading bottle and retry
brew/Library/Homebrew/formula_installer.rb
Lines 221 to 228 in b533b38
def verify_deps_exist | |
begin | |
compute_dependencies | |
rescue CoreTapFormulaUnavailableError => e | |
raise unless Homebrew::API::Bottle.available? e.name | |
Homebrew::API::Bottle.fetch_bottles(e.name) | |
retry |
I'd like to apply the commit from the draft pr and work on that. It's just these json files lack Linux dependencies, should work fine on mac.
But why not download the zip file of homebrew-core and use that as if the repo is cloned? It's about the same size of formula.json(14M).
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.
Ok that makes sense. I'm fine with the PR then as a fix until we can get rid of the API fetch layer everywhere.
In regards to Linux dependencies, there's an issue open for that: Homebrew/formulae.brew.sh#566. It is likely a prerequisite before #12936 can ship.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Could this pull request be merged as a temporary fix? |
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.
Yes, indeed. Thanks! Sorry for forgetting to merge this!
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This should fixes #13040.