Skip to content
Snippets Groups Projects
Commit ce772420 authored by Patrick Gartung's avatar Patrick Gartung Committed by Todd Gamblin
Browse files

Relocate rpaths for all binaries, then do text bin replacement if the rpaths...

Relocate rpaths for all binaries, then do text bin replacement if the rpaths still exist after running patchelf/otool (#17418)
parent 9cc01dc5
No related branches found
No related tags found
No related merge requests found
...@@ -604,13 +604,9 @@ def is_backup_file(file): ...@@ -604,13 +604,9 @@ def is_backup_file(file):
# If we are installing back to the same location don't replace anything # If we are installing back to the same location don't replace anything
if old_layout_root != new_layout_root: if old_layout_root != new_layout_root:
paths_to_relocate = [old_spack_prefix, old_layout_root] files_to_relocate = [os.path.join(workdir, filename)
paths_to_relocate.extend(prefix_to_hash.keys()) for filename in buildinfo.get('relocate_binaries')
files_to_relocate = list(filter( ]
lambda pathname: not relocate.file_is_relocatable(
pathname, paths_to_relocate=paths_to_relocate),
map(lambda filename: os.path.join(workdir, filename),
buildinfo['relocate_binaries'])))
# If the buildcache was not created with relativized rpaths # If the buildcache was not created with relativized rpaths
# do the relocation of path in binaries # do the relocation of path in binaries
if (spec.architecture.platform == 'darwin' or if (spec.architecture.platform == 'darwin' or
...@@ -646,6 +642,13 @@ def is_backup_file(file): ...@@ -646,6 +642,13 @@ def is_backup_file(file):
new_spack_prefix, new_spack_prefix,
prefix_to_prefix) prefix_to_prefix)
paths_to_relocate = [old_prefix, old_layout_root]
paths_to_relocate.extend(prefix_to_hash.keys())
files_to_relocate = list(filter(
lambda pathname: not relocate.file_is_relocatable(
pathname, paths_to_relocate=paths_to_relocate),
map(lambda filename: os.path.join(workdir, filename),
buildinfo['relocate_binaries'])))
# relocate the install prefixes in binary files including dependencies # relocate the install prefixes in binary files including dependencies
relocate.relocate_text_bin(files_to_relocate, relocate.relocate_text_bin(files_to_relocate,
old_prefix, new_prefix, old_prefix, new_prefix,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment