Load formulae from internal API #20384
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: this is still very much a work in progress
The goal here is to load formulae using the new minimal API, and then only load the rest of the formula once we know it’s actually needed. This doesn’t quite work correctly yet, but I wanted to open this in case folks wanted to give feedback on the general approach.
Not yet implemented in this PR:
There are two main categories for
brew
commands:info
,deps
, etc. In these cases, it's appropriate to load the full formula when the arguments are parsed.outdated
,upgrade
,search
. In these cases, we want to intentionally delay loading the full formulae until we're sure we need them.(
install
is kind of a middle-ground since it's on-request but also can stop early if the formula is already installed).So, my plan is to make adjustments to the arg parser so this can be handled at arg-parse time when possible