Repository navigation
formula_pin: pin kegs under an alias or old name - #24655
Merged
Merged
Conversation
Contributor
MikeMcQuaid
enabled auto-merge
November 17, 2026 14:52
Member
|
@hyuraku please email me at [email protected]! nothing bad 😁 |
7 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.
If a keg sits in the rack of an alias or old name,
brew pindoes nothing and prints nothing. A pin that already exists under that name is also ignored:brew upgradeupgrades the formula andbrew unpinsays it is not pinned.brew list --pinnedstill lists it, because it reads the rack names.I found this with automated testing. Kegs stay in alias racks in practice, for example
Cellar/postgresqlafterpostgresqlbecame an alias (#24527).pinfinds the right keg, but it rebuilds the path from the current name's rack, which does not exist, so it returns early.To reproduce:
Now
pinlinks the keg itself under its rack name, andFormulaPin#pathlooks for a pin under each possible name, likeFormula#linked_kegdoes. With the same steps,brew upgrade --dry-run appprintsNot upgrading 1 pinned packageandbrew unpin appworks.brew list --pinnedandMigratoralready use rack names, so they still match.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?AI (Claude Code) found this bug, drafted the fix and test, and checked the steps above before and after the fix. I reviewed the change and ran
brew lgtmlocally.