summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Gartung <gartung@fnal.gov>2020-07-07 16:46:39 -0500
committerGitHub <noreply@github.com>2020-07-07 16:46:39 -0500
commit7f8e827db808c32389a62171abc3baf2ce9e84f9 (patch)
tree3673245a3945ad600cf2a2402c4cb534f4180daf /lib
parenta63761f87542c29e9e026ac8b78894908780c003 (diff)
downloadspack-7f8e827db808c32389a62171abc3baf2ce9e84f9.tar.gz
spack-7f8e827db808c32389a62171abc3baf2ce9e84f9.tar.bz2
spack-7f8e827db808c32389a62171abc3baf2ce9e84f9.tar.xz
spack-7f8e827db808c32389a62171abc3baf2ce9e84f9.zip
Relocate rpaths for all binaries, then do text bin replacement if the rpaths still exist after running patchelf/otool (#17418)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/binary_distribution.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py
index 05a7904815..1659b39283 100644
--- a/lib/spack/spack/binary_distribution.py
+++ b/lib/spack/spack/binary_distribution.py
@@ -604,13 +604,9 @@ def relocate_package(spec, allow_root):
# If we are installing back to the same location don't replace anything
if old_layout_root != new_layout_root:
- paths_to_relocate = [old_spack_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'])))
+ files_to_relocate = [os.path.join(workdir, filename)
+ for filename in buildinfo.get('relocate_binaries')
+ ]
# If the buildcache was not created with relativized rpaths
# do the relocation of path in binaries
if (spec.architecture.platform == 'darwin' or
@@ -646,6 +642,13 @@ def relocate_package(spec, allow_root):
new_spack_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.relocate_text_bin(files_to_relocate,
old_prefix, new_prefix,