1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-08 18:02:05 +03:00

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
This commit is contained in:
Wez Furlong
2020-03-26 05:46:49 -07:00
committed by Facebook GitHub Bot
parent e4988dce82
commit d61c5c4816

View File

@@ -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):
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):