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
extend/os/mac/keg_relocate: fix post-bottling dylib ID relocation #11375
Conversation
Running `brew bottle` changes dylib IDs, install names, and rpaths into placeholders for the bottle, creates a bottle tarball, and then changes the placeholders back to their correct values. With my refactoring in Homebrew#11358, the behaviour of this relocation changed: dylib IDs would no longer be changed back from placeholders into their correct values after the creation of the bottle tarball.
Review period skipped due to |
Is this affecting users who are installing bottles? |
No, it isn't. It'll only affect you if you do
without subsequently trying to install from the bottle you just created. This is why this has caused no problems in CI because we get rid of the broken install immediately then install from the newly created bottle. In particular, this should only impact users who use their own bottling infrastructure with unconventional configurations. These users should be unaffected:
|
Good catch on the fix 👏🏻 |
I've run into an issue, as a "user who uses their own bottling infrastructure with unconventional configurations"... for various complicated reasons, my "bottling infrastructure" is "complicated" in the sense that the bottles for my in-house Tap are not actually built by
If I unzip the bottle, manually use |
This patch should work for you: diff --git a/Library/Homebrew/extend/os/mac/keg_relocate.rb b/Library/Homebrew/extend/os/mac/keg_relocate.rb
index c2bfdc8c8..4581d4681 100644
--- a/Library/Homebrew/extend/os/mac/keg_relocate.rb
+++ b/Library/Homebrew/extend/os/mac/keg_relocate.rb
@@ -23,7 +23,7 @@ class Keg
file.ensure_writable do
if file.dylib?
id = relocated_name_for(file.dylib_id, relocation)
- change_dylib_id(id, file)
+ change_dylib_id(id, file) if id
end
each_linkage_for(file, :dynamically_linked_libraries) do |old_name| However, I'm not sure it's a good idea to be Because if you do build them from |
It definitely is not a good idea (or at least: you should actively expect things to break when doing this and you'll need to fix these problems yourself). |
I agree 100% and I hope I've been clear I'm not demanding a fix for my completely oddball non-standard use case. Without getting too far into the weeds, our Mac clients used to run a script that would download and install our internal tools one-by-one, based on a JSON endpoint that provides download links/version numbers/etc. It was prone to error, took hours to complete, and was completely unworkable once we were all on VPN. I wrote a Homebrew external command to translate that JSON into Formulae so that As for why on earth all of this is happening on endpoint devices instead of in a CI/CD platform... very good question. Our whole dev platform is being migrated to GitHub, at which point we'll be able to do this the right way, but in the (hopefully short) meantime the existing platform basically "is what it is" and I have to make do as best I can. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Running
brew bottle
changes dylib IDs, install names, and rpaths intoplaceholders for the bottle, creates a bottle tarball, and then changes
the placeholders back to their correct values.
With my refactoring in #11358, the behaviour of this relocation changed:
dylib IDs would no longer be changed back from placeholders into their
correct values after the creation of the bottle tarball.