Skip to content

install: isolate formula and cask fetch errors - #23385

Merged
MikeMcQuaid merged 1 commit into
mainfrom
skip-bad-bottles
Aug 2, 2026
Merged

install: isolate formula and cask fetch errors#23385
MikeMcQuaid merged 1 commit into
mainfrom
skip-bad-bottles

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • 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.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Claude Fable 5 with local review and testing.


- 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.
Copilot AI review requested due to automatic review settings July 31, 2026 19:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_installers helper 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.

Comment thread Library/Homebrew/test/install_spec.rb
@MikeMcQuaid
MikeMcQuaid enabled auto-merge August 1, 2026 13:29
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 2, 2026
Merged via the queue into main with commit 74dce14 Aug 2, 2026
45 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the skip-bad-bottles branch August 2, 2026 16:08
@zzzzzzzaa321-gif

This comment has been minimized.

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.

Brew upgrade aborts the entire batch when download queue contains a malformed URI

4 participants