Merged
Conversation
6392784 to
fb5a423
Compare
This will parallelise fetching of formulae and casks in `brew bundle`.
fb5a423 to
97621a7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements parallel fetching of formulae and casks in brew bundle by running brew fetch before brew install to improve performance. The implementation collects all packages that need to be installed or upgraded, fetches them in a single parallel operation, and then proceeds with sequential installation.
Key Changes
- Added prefetching logic that identifies formulae and casks needing installation/upgrade before the installation phase
- Introduced
installable_or_upgradable?method in CaskInstaller to determine which casks should be fetched - Modified installer workflow to fetch all applicable packages in parallel before sequential installation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Library/Homebrew/bundle/installer.rb | Refactored to collect installable entries, added fetchable_formulae_and_casks method to identify packages for prefetching, and added fetch step before installation loop |
| Library/Homebrew/bundle/cask_installer.rb | Added installable_or_upgradable? helper method to determine if a cask needs fetching/installation |
| Library/Homebrew/test/bundle/installer_spec.rb | New test file covering prefetch behavior for both formulae and casks, including edge case where nothing needs fetching |
| Library/Homebrew/test/bundle/commands/install_spec.rb | Updated test mocks to accommodate new fetch calls and removed outdated expectation that system would never be called |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bevanjkay
approved these changes
Dec 21, 2025
Member
bevanjkay
left a comment
There was a problem hiding this comment.
I have completed some limited testing locally and can confirm it works for installations and upgrades. This is a great improvement!
p-linnane
approved these changes
Dec 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Run
brew fetchbeforebrew installThis will parallelise fetching of formulae and casks in
brew bundleNote dependencies are not properly handled yet but that could be a future extension if someone cares enough.
Fixes #21140