install: isolate formula and cask fetch errors - #23385
Merged
Merged
Conversation
- One malformed formula or cask (e.g. a bottle `root_url` that is an invalid URI) raised while enqueueing downloads and aborted the whole `brew upgrade` batch with an internal stack trace. - Rescue anything raised by an individual formula's or cask's prelude and enqueue steps so the offending package is reported and skipped, the rest still proceed and the command exits nonzero. Fixes #23377.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the resilience of brew install/brew upgrade batch fetch/enqueue flows by isolating per-formula and per-cask failures during download queue preparation, so one malformed package reports an error and is skipped while the rest continue (exiting nonzero overall).
Changes:
- Refactors formula fetch prelude/enqueue steps into a shared
select_formula_installershelper that rescues per-installer failures and filters out offenders. - Updates cask installer enqueue logic to rescue and skip failures during pre-fetch collection and during enqueue, allowing the batch to proceed.
- Adds RSpec coverage for “skip the bad item, continue with the rest” behavior for both formulae and casks.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/install.rb | Adds per-item error isolation for formula and cask fetch/enqueue steps, filtering out failing items and continuing the batch. |
| Library/Homebrew/test/install_spec.rb | Adds specs asserting batch continuation when an individual formula/cask fetch/enqueue step raises. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeMcQuaid
enabled auto-merge
August 1, 2026 13:29
p-linnane
approved these changes
Aug 2, 2026
This comment has been minimized.
This comment has been minimized.
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.
root_urlthat is an invalid URI) raised while enqueueing downloads and aborted the wholebrew upgradebatch with an internal stack trace.Fixes #23377.
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Fable 5 with local review and testing.