Skip to content

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Aug 5, 2025

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:

  1. The user requests action for a specific formula. For example, info, deps, etc. In these cases, it's appropriate to load the full formula when the arguments are parsed.
  2. Bulk actions, like 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

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far! Once it's working OK for you locally would suggest trying to split out the bits that are refactoring no-ops of existing code and getting them merged in to slim the diff.

@Rylan12 Rylan12 force-pushed the load-formulae-from-internal-api branch from 7a3e2ec to 32a833a Compare August 8, 2025 05:03
@Rylan12 Rylan12 closed this Aug 18, 2025
@Rylan12 Rylan12 deleted the load-formulae-from-internal-api branch August 18, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants