Skip to content
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

Always set rpath to point at the .libs directory #344

Open
ender-wieczorek opened this issue Oct 25, 2021 · 0 comments
Open

Always set rpath to point at the .libs directory #344

ender-wieczorek opened this issue Oct 25, 2021 · 0 comments

Comments

@ender-wieczorek
Copy link

When grafting a library, it's dependencies are either:

  • available on the system (as specified in the policy)
  • also grafted into the wheel.

So, we should always set the rpath of the grafted library to point at the .libs directory.

Currently (see

patcher.set_rpath(dest_path, dest_dir)
):

  • we only set the rpath if the library already has rpath or runpath set
  • set the rpath to a relative path. Note that relative paths are interpreted by the dynamic linker as relative to the current working directory, not relative to the library. To use a path relative to the library, we need $ORIGIN.

So, the patch I'm proposing is:

--- repair.py	2021-10-23 04:36:19.144441648 +0000
+++ repair.py	2021-10-23 04:36:38.860464792 +0000
@@ -151,8 +151,7 @@
 
     patcher.set_soname(dest_path, new_soname)
 
-    if any(itertools.chain(rpaths["rpaths"], rpaths["runpaths"])):
-        patcher.set_rpath(dest_path, dest_dir)
+    patcher.set_rpath(dest_path, "$ORIGIN")
 
     return new_soname, dest_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant