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
info: check latest runtime deps before printing - #24430
Follow-up to #24425, which was merged before CodeRabbit's review came in. Both of its findings were real.
An outdated formula whose installed keg has an empty receipt showed no Recursive Runtime line, even when the latest version has runtime dependencies, because #24425 only computed the latest dependencies after checking that the receipt listed some. Nine of my outdated formulae hit this, for example coreutils, whose latest version has 3 recursive runtime dependencies:
When the latest version's dependencies can't be determined, for example because one comes from a tap that isn't tapped, runtime_dependencies prints an error and returns []. The line below that error then said Recursive Runtime (0): all installed ✔.
The dependencies are now computed before the check, so the line is printed whenever there are dependencies to count, and only the error is shown when they can't be determined:
❯ brew info coreutils==> coreutils: 8.29 → stable 9.12_1, HEAD...==> DependenciesRequired (2): gmp, openssl@4Recursive Runtime (3): all installed ✔==> Options
Missing libraries is printed inside the Dependencies section, which is skipped when there is nothing else to list. The receipt check used to keep that section open for an outdated keg whose latest version dropped all of its dependencies, so it now also opens when there are missing libraries.
Up-to-date and uninstalled formulae are unaffected. The only new work is the latest-dependencies lookup for outdated formulae with an empty receipt, which other outdated formulae already do since #24425.
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; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.
Claude Code (Claude Opus 5.5) checked CodeRabbit's findings on #24425 and this PR against the code, wrote the changes and their specs and verified them. Each new spec fails without its change, one of them with the Recursive Runtime (0): all installed ✔ output, and passes with it. It ran brew lgtm, which passes, and the coreutils output above is from my install, the second with this branch's info.rb.
- `Recursive Runtime` only computed the latest version's dependencies
when the outdated keg's receipt listed some, so a keg with an empty
receipt showed no line even when the latest version has dependencies.
- When the latest dependencies couldn't be determined,
`runtime_dependencies` returns `[]` after printing an error and the
line said "Recursive Runtime (0): all installed".
- Compute the dependencies first and print the line only when there
are some.
No actionable comments were generated in the recent review.
Recent 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: 6e3e2258-51fd-448a-8824-ec243e3f3611
Commits
Reviewing files that changed from the base of the PR and between 0329859 and 7a06cb5.
Files selected for processing: 2
Library/Homebrew/cmd/info.rb
Library/Homebrew/test/cmd/info_spec.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Summary
Summary by CodeRabbit
Bug Fixes
The formula information command now reports current runtime dependencies for outdated formulae, including dependencies that are not installed.
The Recursive Runtime section appears when relevant dependency information, including missing libraries, is available, and is omitted when that information cannot be determined.
Tests
Added coverage for outdated formulae with no installed runtime dependencies, unavailable current dependency information, and missing libraries as the only dependency information.
The info command selects runtime dependencies based on whether a formula is outdated. It uses the selected dependencies when deciding whether to display the Dependencies section. The section check also considers missing libraries. Tests cover outdated formulae with empty or unavailable runtime dependency data.
Changes: Runtime dependency reporting
Layer / File(s)
Summary
Dependency selection and section visibility Library/Homebrew/cmd/info.rb, Library/Homebrew/test/cmd/info_spec.rb
Outdated formulae use current formula runtime dependencies; other formulae use tab runtime dependencies. The Dependencies section check also considers missing libraries and selected runtime dependencies. Tests cover an outdated formula with a current dependency absent from its tab, an empty latest-version dependency list, and missing libraries.
Merge Risk: Minimal · up to 7a06c
No merge-blocking issue is established; failed dependency lookups can still show other available information.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "info: check latest runtime deps before printing" matches the main change. The PR computes the latest version's runtime dependencies before checking the installed keg's receipt, so the Recur…
Description check
The description explains the bug, the cause (#24425 computed latest dependencies only after checking the receipt), the fix, and the affected output. It includes a coreutils example, the missing-librar…
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 "info: check latest runtime deps before printing" matches the main change. The PR computes the latest version's runtime dependencies before checking the installed keg's receipt, so the Recursive Runtime line appears for outdated formulae with an empty receipt. The title is short, specific, and states the primary change. It does not cover the missing-libraries change, which is expected for a title.
Full details: Description check
Explanation
The description explains the bug, the cause (#24425 computed latest dependencies only after checking the receipt), the fix, and the affected output. It includes a coreutils example, the missing-libraries change, the scope of the change, and test and lint verification. It relates directly to the changeset.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Exercise the real diagnostic path for an unresolved latest dependency set.
The example at Library/Homebrew/test/cmd/info_spec.rb:775-800 stubs runtime_dependencies directly. This bypasses the FormulaUnavailableError rescue at Library/Homebrew/formula.rb:3005-3007, which emits Could not get runtime dependencies. The example checks only that the Recursive Runtime line is absent. It does not check the error message, so it can still pass if that onoe call is removed.
Stub declared_runtime_dependencies to raise FormulaUnavailableError instead. The real runtime_dependencies then runs its rescue. Assert the error message and the absence of Recursive Runtime.
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: 3dc39c05-aa24-48df-a084-4deb0793cab3
Commits
Reviewing files that changed from the base of the PR and between 244bd01 and 41ef2a7.
Files selected for processing: 2
Library/Homebrew/cmd/info.rb
Library/Homebrew/test/cmd/info_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.
- `Missing libraries` is printed in the `Dependencies` section, which
was skipped when there were no dependencies or dependents to list.
The receipt check used to keep the section open for outdated kegs
whose latest version dropped all its dependencies.
- Open the section when there are missing libraries too.
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.
Follow-up to #24425, which was merged before CodeRabbit's review came in. Both of its findings were real.
An outdated formula whose installed keg has an empty receipt showed no
Recursive Runtimeline, even when the latest version has runtime dependencies, because #24425 only computed the latest dependencies after checking that the receipt listed some. Nine of my outdated formulae hit this, for example coreutils, whose latest version has 3 recursive runtime dependencies:When the latest version's dependencies can't be determined, for example because one comes from a tap that isn't tapped,
runtime_dependenciesprints an error and returns[]. The line below that error then saidRecursive Runtime (0): all installed ✔.The dependencies are now computed before the check, so the line is printed whenever there are dependencies to count, and only the error is shown when they can't be determined:
Missing librariesis printed inside theDependenciessection, which is skipped when there is nothing else to list. The receipt check used to keep that section open for an outdated keg whose latest version dropped all of its dependencies, so it now also opens when there are missing libraries.Up-to-date and uninstalled formulae are unaffected. The only new work is the latest-dependencies lookup for outdated formulae with an empty receipt, which other outdated formulae already do since #24425.
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Claude Opus 5.5) checked CodeRabbit's findings on #24425 and this PR against the code, wrote the changes and their specs and verified them. Each new spec fails without its change, one of them with the
Recursive Runtime (0): all installed ✔output, and passes with it. It ranbrew lgtm, which passes, and the coreutils output above is from my install, the second with this branch'sinfo.rb.