Repository navigation
Handle symlinked prefixes when linking kegs - #24376
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Resolve Cellar paths and test symlinked-prefix linking Library/Homebrew/keg.rb, Library/Homebrew/test/keg_spec.rb |
Keg.for constructs the keg path from the Cellar constant and the input path relative to the resolved Cellar. The test checks that a nested header remains accessible after linking two kegs with a symlinked prefix. |
Priority:
Merge Risk: 
Minimal · up to e47bf
-
The reported symlinked-prefix linking failure is addressed, and the regression test checks that the header remains accessible after the merge. No actionable merge-blocking risk remains after normal checks.
Pre-merge checks: 
4
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 1

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:
7363469b-4886-4f62-93dc-7e9bf103efa6
Files selected for processing: 2-
Library/Homebrew/keg.rbLibrary/Homebrew/test/keg_spec.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.
-
There was a problem hiding this comment.
Actionable comments posted: 1

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:
6dae099d-cff4-4871-8aa9-5445459631cf
Files selected for processing: 2-
Library/Homebrew/keg.rbLibrary/Homebrew/test/keg_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.
-
|
Is this the only issue you see with this configuration and everything else works perfectly? If so, surprising but cool. My concern is there's likely a bunch of failure states and we drip-drip PRs adding complexity for an unsupported configuration. |
Surprisingly, yes. This is the only issue that I've run into in the past few months with this symlink setup. It would be nice if we can have this case supported as, you know, Homebrew is not known for allowing each user to install their own copy other than having to recompile everything from scratch. |
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Ok, let's try this, thanks!
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?I did not use AI/LLM to create this PR, orI 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.I am using my custom setup that allows multiple Linux users to install Homebrew independently without conflict, by having a FUSE program present
/home/linuxbrew/.linuxbrewas a symbolic link that points to the visiting user's home directory. This causesbrew installandbrew upgradeto intermittently attempt to operate on the root directory:This is reproduceable by having
/home/linuxbrew/.linuxbrewas a symbolic link that points to somewhere else and trying to install certain formulae.This PR fixes the issue described above.
AI Use Disclosure: Codex (GPT-5.6 Sol) identified the problem from the code and made the changes. I personally reviewed the changes before submitting this PR.