Commit 2f2a55e3 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook GitHub Bot

getdeps: fixup the dyndeps fixed up by fixup dyndeps

Summary:
On linux we didn't account for the `--final-install-prefix` argument
which meant that the binaries would always be rewritten to be relative to
the destdir.

This commit fixes that.

Refs: https://github.com/facebook/watchman/issues/760

(this doesn't deal with the compiled in statedir being in the scratch path though)

Reviewed By: simpkins

Differential Revision: D20659749

fbshipit-source-id: 1e8e198a58361882249c33a67f54a7d97b849257
parent 9067e9e0
...@@ -203,9 +203,11 @@ class ElfDeps(DepBase): ...@@ -203,9 +203,11 @@ class ElfDeps(DepBase):
subprocess.check_call([sys.executable, sys.argv[0], "build", "patchelf"]) subprocess.check_call([sys.executable, sys.argv[0], "build", "patchelf"])
# ... and that we know where it lives # ... and that we know where it lives
self.patchelf = os.path.join( self.patchelf = os.path.join(
subprocess.check_output( os.fsdecode(
[sys.executable, sys.argv[0], "show-inst-dir", "patchelf"] subprocess.check_output(
).strip(), [sys.executable, sys.argv[0], "show-inst-dir", "patchelf"]
).strip()
),
"bin/patchelf", "bin/patchelf",
) )
...@@ -221,8 +223,11 @@ class ElfDeps(DepBase): ...@@ -221,8 +223,11 @@ class ElfDeps(DepBase):
return lines return lines
def rewrite_dep(self, objfile, depname, old_dep, new_dep, final_lib_dir): def rewrite_dep(self, objfile, depname, old_dep, new_dep, final_lib_dir):
final_dep = os.path.join(
final_lib_dir, os.path.relpath(new_dep, self.munged_lib_dir)
)
subprocess.check_call( subprocess.check_call(
[self.patchelf, "--replace-needed", depname, new_dep, objfile] [self.patchelf, "--replace-needed", depname, final_dep, objfile]
) )
def is_objfile(self, objfile): def is_objfile(self, objfile):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment