G
YouTube TikTok Games
Skip to content

info: check latest runtime deps before printing - #24430

Merged
HaraldNordgren merged 2 commits into
mainfrom
info-recursive-runtime-empty-receipt
Nov 1, 2026
Merged

HaraldNordgren merged 2 commits into
mainfrom
info-recursive-runtime-empty-receipt

Conversation

@HaraldNordgren

@HaraldNordgren HaraldNordgren commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

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:

❯ brew info coreutils
==> coreutils: 8.29 → stable 9.12_1, HEAD
...
==> Dependencies
Required (2): gmp, openssl@4
==> Options

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
...
==> Dependencies
Required (2): gmp, openssl@4
Recursive 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 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 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.
@HaraldNordgren
HaraldNordgren force-pushed the info-recursive-runtime-empty-receipt branch from 41ef2a7 to 0329859 Compare November 1, 2026 19:59
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: Passed 4
Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Nitpick comments: 1
Library/Homebrew/test/cmd/info_spec.rb: 1

775-800: Trivial · Maintainability & Code Quality · Quick win

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.

Comment thread Library/Homebrew/cmd/info.rb Resolved
- `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.

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@HaraldNordgren
HaraldNordgren added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 59604a8 Nov 1, 2026
55 checks passed
@HaraldNordgren
HaraldNordgren deleted the info-recursive-runtime-empty-receipt branch November 1, 2026 22:01
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.

2 participants