keg: fix any_skip_relocation cellar on Linux#22441
Merged
Merged
Conversation
b1b5138 to
a149f5c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes Linux bottle cellar selection for :any_skip_relocation vs :any by properly tracking when a keg actually required binary relocation, aligning the skip_relocation decision in brew bottle with real ELF patching activity.
Changes:
- Add a typed
@require_relocationflag toKegand introduce arequire_relocation!setter. - Use
require_relocation!in macOS Mach-O relocation helpers instead of directly mutating the ivar. - On Linux, mark relocation as required when ELF
rpath/interpreter patching occurs (and avoid reporting relocation when no changes are made).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Library/Homebrew/keg.rb |
Types @require_relocation and adds require_relocation! to centralize relocation state changes. |
Library/Homebrew/extend/os/mac/keg.rb |
Switches Mach-O change helpers to call require_relocation! instead of setting the ivar directly. |
Library/Homebrew/extend/os/linux/keg_relocate.rb |
Sets relocation-required state when ELF patching happens, improving :any vs :any_skip_relocation detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 lgtm(style, typechecking and tests) with your changes locally?On Linux,
:any_skip_relocationvs:anydetection has been historically broken which is why we've ignored the value.brew/Library/Homebrew/extend/os/linux/bottle_specification.rb
Lines 6 to 8 in edf610a
This PR tries to fix the actual cellar symbol used.
It does not fix the above
skip_relocation?check yet. Thinking of fixing a few bottles first and using those to test this part later on. Will likely need to access tab information to checkparsed_homebrew_versionaligned to next release (e.g. >= 5.1.15).Ran a few local checks on formulae via
brew install --build-bottleandbrew bottle:snappy- should be any bottle but currently isn't https://github.com/Homebrew/homebrew-core/blob/main/Formula/s/snappy.rb#L17-L18. Local test outputs:fx- checking no regression on any_skip_relocationlibfaketime- checking no regression on non-relocatableNot sure if our tests cover any of this yet.