-
-
Notifications
You must be signed in to change notification settings - Fork 11k
Description
Verification
- This issue's title and/or description do not reference a single formula e.g.
brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.
Provide a detailed description of the proposed feature
Currently, we rewrite all library install names to something like opt_prefix/library_install_name.basename.
brew/Library/Homebrew/extend/os/mac/keg_relocate.rb
Lines 24 to 27 in e62a839
| if file.dylib? | |
| id = relocated_name_for(file.dylib_id, relocation) | |
| change_dylib_id(id, file) | |
| end |
Typically, these will be because the install name refers to a Cellar path, e.g., prefix/library_install_name.basename. The install name rewriting allows us to avoid unnecessary rebuilds of dependents with version/revision bumps.
This install name rewriting isn't needed when the install name starts with @rpath, because these will typically not hardcode a Cellar path reference that will need to be rebuilt on version/revision bumps.
Formulae should support some sort of DSL that makes the code in keg_relocate.rb skip rewriting an install name if it starts with @rpath.
What is the motivation for the feature?
Our rewriting of @rpath-prefixed install names breaks macdeployqt. See Homebrew/discussions#2823.
This is arguably an upstream bug, but convincing upstream to fix it is unlikely to succeed without a reproduction of the issue outside of Homebrew, and I don't think anyone has the time or energy to do this. Even if one had such a reproducer, it would likely still be rather difficult to convince upstream to fix this short of providing a patch.
Such a DSL could also replace a very old workaround in Rust:
def post_install
Dir["#{lib}/rustlib/**/*.dylib"].each do |dylib|
chmod 0664, dylib
MachO::Tools.change_dylib_id(dylib, "@rpath/#{File.basename(dylib)}")
MachO.codesign!(dylib) if Hardware::CPU.arm?
chmod 0444, dylib
end
endHow will the feature be relevant to at least 90% of Homebrew users?
It probably won't be, but it would likely be relevant to our users who use Qt, which form a non-negligible fraction of our user base.
What alternatives to the feature have been considered?
See alternatives described in this comment.