-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't relocate Apple Silicon bottles for default prefix #19384
base: master
Are you sure you want to change the base?
Don't relocate Apple Silicon bottles for default prefix #19384
Conversation
This change skips the relocation process for bottles on Apple Silicon Macs when using the default prefix (/opt/homebrew). Relocation was initially needed for Intel Macs to avoid wide-reaching replacements with false positives, but is unnecessary for Apple Silicon where the default prefix is unique. Benefits: - Simplifies and speeds up bottle pouring on Apple Silicon - Potentially enables code-signing of homebrew-core packages - Improves security by avoiding binary modification post-build A --force-bottle-relocation flag is added for edge cases where relocation might still be needed. Fixes Homebrew#19247
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @samuelarogbonlo! Looks good so far. I suspect a bit more work required here and may need to do a gradual rollout with e.g. ENV.fetch("HOMEBREW_BOTTLE_SKIP_RELOCATION_ARM64", false)
or something.
@cho-m and other @Homebrew/maintainers may be able to suggest some next steps here.
As discussed already: this should probably do something along the lines of:
- see if any binary files need relocation with RubyMacho. if so: can skip text relocation. if not: can do text relocation.
- store whether relocation happened or not in e.g. the bottle manifest or the tab
Shout if you have more questions or we can help more here. Thanks for the PR ❤️
Agree regarding more work here. My view is that what we really want for arm64 is to move bottle relocation from bottle-creation time to bottle-pour time. It'll be a no-op for default prefix installations, but still works largely the same way for users with alternative prefixes. |
…out, remove force flag
Based on the feedback, I've updated the implementation to:
For the next steps, I'd like to address the remaining suggestions:
I'd appreciate some guidance on how to best implement these remaining items, particularly around using RubyMacho for analyzing binaries, and the preferred approach for tracking relocation status in the bottle metadata. Are there examples in the existing codebase I should look at for reference? |
Hey @samuelarogbonlo, thanks for giving this a go! I don't think I'll have answers to all your questions, but I'll try to give you more detailed guidance in a few days. Feel free to ping me this weekend as a reminder. |
@carlocab This is a friendly reminder. Thanks |
This change skips the relocation process for bottles on Apple Silicon Macs when using the default prefix (/opt/homebrew). Relocation was initially needed for Intel Macs to avoid wide-reaching replacements with false positives, but is unnecessary for Apple Silicon where the default prefix is unique.
Benefits:
A --force-bottle-relocation flag is added for edge cases where relocation might still be needed.
Fixes #19247
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?