-
Notifications
You must be signed in to change notification settings - Fork 68
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
mac: relink 'libfoo.dylib' as '@rpath/libfoo.dylib' #1477
Conversation
similar to conda-build and fix $PREFIX/lib/libfoo.dylib as `@rpath/libfoo.dylib`, which was checking the wrong prefix
While this correctly rewrites the paths now, I think I may have found a different bug, because this produces libraries that crash on loading if the builtin relink is used. If I skip the builtin and go straight to relinking with |
The crashes appear to be related to updating the codesignature (e.g. not doing it):
The |
Yes, after any relink we need to run codesign again. The |
ah, the crash is apparently because I have I guess this code doesn't catch exit codes or report errors. This is unrelated, I'll open a separate issue to avoid getting too far off track. I'm not sure if rattler-build is expected to work with conda-forge-distributed |
ok, after fixing my codesigning issue (#1478), this PR does appear to be working as intended, with both relink implementations. But there are still no tests to exercise |
We have some test binaries, and we can re-read the modified binary to check that the value meets the expectations. Maybe you can take the test binary in I'll make sure that codesigning works (and fails) as expected in #1479 |
Hey @minrk - i pushed some changes to use the actual Can you test your recipe against this change? |
Yes, this produces the expected result. Thanks! |
@minrk would you be able to add your test recipe to |
When I run your recipe I think the test is exiting with |
hm, it passes for me because difft doesn't set the exit code by default. I'll look into adding it. The diff isn't part of the test, it's just for viewing purposes, so not really needed when bringing it into this repo |
I think it wasn't passing for me because I didn't pull in the codesign changes. Now it passes. Sorry. |
verifies that both absolute `$PREFIX/lib/lib...` and relative `lib...` links are rewritten to `@rpath/lib...`
Added a slightly simplified version that checks for the expected rewrites with a simple |
Thank you so much! |
similar to conda-build, but not the same. conda-build searches a lot more, and sets the link to find any matching file anywhere in the package, whereas this only handles the case where it's in $PREFIX/lib.
This also fixes an erroneous check for absolute path install_name for dylibs in $prefix/lib. The check was
strip_prefix(prefix)
whereas it should have beenstrip_prefix(encoded_prefix.join("lib"))
if it were to match the path of absolute install_names.I'm not sure how to add a test for this in this repo, but this sample recipe is fixed by it.
closes #1476
(feel free to ignore my code and rewrite with your own fix, I don't know how to rust).