You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
install, reinstall, upgrade: show the same plan details - #24661
brew install, brew reinstall and brew upgrade each print a plan before they ask to go ahead and with --dry-run, but they built it in separate code and showed different details. Only brew upgrade listed bottle download sizes and the formulae that would build from source.
This moves the bottle size and source build helpers from the upgrade command into Install and uses them for every plan, so all three commands show the same details, both with --dry-run and before the prompt. The source build list now covers dependencies in every plan, using the same install_bottle_for? check as dependency expansion. It also drops the unused compute_total_sizes and collect_dependencies helpers.
brew upgrade now records its plan and decides whether to prompt after dependencies are computed, so a formula with unsatisfied requirements fails on its own instead of aborting the whole plan.
$ brew install --dry-run wireshark iso-codes
==> Would install 2 formulae:
wireshark 4.6.9
iso-codes 4.20.1 (8.3MB)
==> Would install 6 dependencies for wireshark:
c-ares 1.34.9
libgpg-error 1.61
libgcrypt 1.12.4
libmaxminddb 1.14.1
libsmi 0.5.0
speexdsp 1.2.1
==> 6 homebrew/core formulae that would build from source
wireshark
c-ares
libgpg-error
libgcrypt
libmaxminddb
libsmi
$ brew upgrade --dry-run git pycparser
==> Would upgrade 2 requested outdated packages
git 2.56.0_2 -> 2.56.1
pycparser 3.1_1 -> 3.12 (78.8KB)
==> 1 homebrew/core formula that would build from source
git
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 brew benchmark results.
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; every commit has a human author or co-author and I will answer maintainer questions and review comments myself without AI/LLM.
Claude Code (Fable 5.2) made the code and test changes from my instructions. It also ran the checks on my machine: brew lgtm, then brew style, brew typecheck and the install, reinstall and upgrade specs after a later fix, plus read-only --dry-run runs against my installed formulae. I reviewed the diff and tried the plans with my own brew.
Dry-run installation and upgrade plans show the count and names of formulae expected to build from source, including eligible dependencies.
Plans distinguish bottled formulae from source builds and show download sizes for formulae that will be installed from bottles.
Upgrade summaries provide clearer details about bottle downloads and source builds.
Bug Fixes
Dry-run upgrade summaries remain available when dependency checks encounter an error, which is also reported in the output.
Install and upgrade dry-run plans report bottle sizes where available and identify eligible formulae that will build from source. Upgrade summaries are recorded after upgrade calls, including when dependency computation reports an UnsatisfiedRequirements error.
Changes: Formula install and upgrade plans
Layer / File(s)
Summary
Install plan reporting Library/Homebrew/install.rb, Library/Homebrew/test/cmd/install_spec.rb, Library/Homebrew/test/install_spec.rb
Install dry runs use installer data to report bottle sizes and list eligible homebrew/core formulae that will build from source. Tests cover bottled and source-built formulae and dependencies.
Upgrade version changes accept an optional size. Upgrade summaries use shared bottle-size and source-build helpers and are recorded after upgrade calls. Tests cover dry-run plans and dependency-computation errors.
Merge Risk: Low · up to c093b
The change makes install, reinstall and upgrade plans show the same details. The main residual concern is whether an upgrade preview with an unsatisfied formula could still abort the whole plan. The change appears to address it, but it deserves a quick confirmation before merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the three commands it changes (install, reinstall, upgrade) and the change they share (showing the same plan details). The changeset moves bottle-size and source-build reporting into I…
Description check
The description explains the motivation, the moved helpers, the new source-build list covering dependencies, the removed unused helpers, and the upgrade prompt-timing change. It also includes example …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the three commands it changes (install, reinstall, upgrade) and the change they share (showing the same plan details). The changeset moves bottle-size and source-build reporting into Install and uses it for all three plans, so the title covers the main change.
Full details: Description check
Explanation
The description explains the motivation, the moved helpers, the new source-build list covering dependencies, the removed unused helpers, and the upgrade prompt-timing change. It also includes example output and testing notes, all of which match the changeset.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Major · Run the prompt requirement check after the isolated upgrade pass. · install.rb:653
Library/Homebrew/install.rb:653 Major · Stability & Availability · Quick win
Run the prompt requirement check after the isolated upgrade pass.
With brew upgrade --dry-run foo bar, the prompt requirement check calls compute_dependencies on foo before Upgrade.upgrade_formulae isolates any failure. If foo has an unsatisfied fatal requirement, compute_dependencies raises UnsatisfiedRequirements. No rescue in cmd/upgrade.rb covers this call, so the command stops before bar is processed and before the dry-run summary is recorded.
The PR goal is that an unsatisfied formula fails on its own without aborting the plan. Move the prompt requirement check after Upgrade.upgrade_formulae, and base it on the installers that upgrade successfully. Keep dependency-based prompting for formulae that succeed.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 90b5c09a-a382-48ae-9976-f7ec4da937d4
Commits
Reviewing files that changed from the base of the PR and between b43c73f and bf45204.
Files selected for processing: 6
Library/Homebrew/cmd/upgrade.rb
Library/Homebrew/install.rb
Library/Homebrew/test/cmd/install_spec.rb
Library/Homebrew/test/cmd/upgrade_spec.rb
Library/Homebrew/test/install_spec.rb
Library/Homebrew/upgrade.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
HaraldNordgren
changed the title
install: show bottle sizes and source builds
install, reinstall, upgrade: show the same plan details
Nov 17, 2026
- `brew install` and `brew reinstall` ask before a plan that only lists
names and versions, so nothing says which formulae pour a bottle and
which build from source. `brew upgrade` already shows both.
- Move the bottle size and source build helpers from the `upgrade`
command into `Install` so all three plans print the same details.
- List dependencies in the source build section too, as they make up
most of an install plan.
- Record the `upgrade` dry-run summary after its dependencies are
computed, so a formula with unsatisfied requirements still only
fails on its own.
- Drop the unused `compute_total_sizes` and `collect_dependencies`
helpers to keep `Install` within the module length limit.
- A named `brew upgrade --dry-run` decided whether to prompt by
computing dependencies before the per-formula error handling, so a
formula with an unsatisfied requirement aborted the whole plan.
- Decide after the dry-run pass, from the formulae that got through,
so that formula fails on its own like it does without names.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 3fd87f54-fbe9-42bf-98a9-832dadddea9d
Commits
Reviewing files that changed from the base of the PR and between dd336ce and 10b949a.
Files selected for processing: 1
Library/Homebrew/install.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
- `brew install` and `brew reinstall` plans now look up bottle sizes,
so a manifest download that fails, e.g. offline, stopped the whole
plan. The installer itself already ignores these failures when it
reads the manifest.
- Show the plan without the size instead. This also covers the
existing `brew upgrade` size lookup.
- Installing a local bottle file downloads nothing, but the plan
showed the size of the hosted bottle and fetched its manifest to
get it. The installer already skips the manifest for local bottles.
Assert that a local bottle skips the hosted bottle lookup.
The test checks that bottle_download_size returns nil. It would also pass if the helper fetched the hosted manifest and then discarded the size. Keep the nil assertion and replace the bottle stub with expect(formula).not_to receive(:bottle).
Based on learnings, “Formula classes created in specs may be frozen, so stub instances rather than class methods.”
Source: Learnings
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 9cc00ba6-3df8-40fa-a63e-3b95ef900cc4
Commits
Reviewing files that changed from the base of the PR and between 10b949a and c093b0a.
Files selected for processing: 2
Library/Homebrew/install.rb
Library/Homebrew/test/install_spec.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
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
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.
brew install,brew reinstallandbrew upgradeeach print a plan before they ask to go ahead and with--dry-run, but they built it in separate code and showed different details. Onlybrew upgradelisted bottle download sizes and the formulae that would build from source.This moves the bottle size and source build helpers from the
upgradecommand intoInstalland uses them for every plan, so all three commands show the same details, both with--dry-runand before the prompt. The source build list now covers dependencies in every plan, using the sameinstall_bottle_for?check as dependency expansion. It also drops the unusedcompute_total_sizesandcollect_dependencieshelpers.brew upgradenow records its plan and decides whether to prompt after dependencies are computed, so a formula with unsatisfied requirements fails on its own instead of aborting the whole plan.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Fable 5.2) made the code and test changes from my instructions. It also ran the checks on my machine:
brew lgtm, thenbrew style,brew typecheckand the install, reinstall and upgrade specs after a later fix, plus read-only--dry-runruns against my installed formulae. I reviewed the diff and tried the plans with my ownbrew.