Repository navigation
doctor: skip removed formulae in unlinked check - #24466
Merged
Merged
Conversation
- `check_deleted_formula` already tells users to find replacements for these kegs, but `check_for_unlinked_but_not_keg_only` also asks to `brew link` them. - With no formula in any tap, `Formulary.from_rack` loads the keg's `.brew/` copy, which can predate it becoming keg-only, so linking `python@3.8` with `--overwrite` would take `python3` from the current Python.
Contributor
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
MikeMcQuaid
enabled auto-merge
November 4, 2026 09:03
HaraldNordgren
disabled auto-merge
November 4, 2026 09:43
8 tasks done
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.
brew doctortold me to find replacements forsixandpython@3.8, then told me to link them:The second warning is wrong for those two. Once a formula is gone from its tap,
Formulary.from_rackloads the copy saved in the keg's.brew/directory, and that copy can be out of date.python@3.8became keg-only on 2020-10-28, but my keg was installed earlier that month, so its copy says it isn't keg-only. Following the advice withbrew link --overwrite python@3.8would takepython3andpip3away frompython@3.15.This skips kegs that
Keg#deleted_formula?flags, becausecheck_deleted_formulaalready reports them.sixandpython@3.8drop out of the list, and the other four are still suggested. Kegs installed from a local file also count as deleted, so they're no longer suggested for linking either, but they're still listed under "no formulae".To reproduce:
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Claude Opus 5.5) traced why
brew doctorgave both warnings, wrote the change and its specs and verified them. The new spec for removed formulae fails without the change and passes with it. It ran the reproduction steps before and after the change, ran the new check against my install and ranbrew lgtm, which passes.