summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreugeneswalker <38933153+eugeneswalker@users.noreply.github.com>2021-01-20 12:43:07 -0800
committerTamara Dahlgren <dahlgren1@llnl.gov>2021-02-17 17:07:44 -0800
commit18022050f21130cfcce1ad9d8ff17bca4ba3f7cc (patch)
tree2c7d4a0370e75eece84bafd2417b06167689a088
parentcdd86bddecacb1201ca306992265e0f255cda7e3 (diff)
downloadspack-18022050f21130cfcce1ad9d8ff17bca4ba3f7cc.tar.gz
spack-18022050f21130cfcce1ad9d8ff17bca4ba3f7cc.tar.bz2
spack-18022050f21130cfcce1ad9d8ff17bca4ba3f7cc.tar.xz
spack-18022050f21130cfcce1ad9d8ff17bca4ba3f7cc.zip
store sbang_install_path in buildinfo, use for subsequent relocation (#20768)
-rw-r--r--lib/spack/spack/binary_distribution.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py
index a5fb94a770..4390611315 100644
--- a/lib/spack/spack/binary_distribution.py
+++ b/lib/spack/spack/binary_distribution.py
@@ -599,7 +599,9 @@ def write_buildinfo_file(spec, workdir, rel=False):
text_to_relocate.append(rel_path_name)
# Create buildinfo data and write it to disk
+ import spack.hooks.sbang as sbang
buildinfo = {}
+ buildinfo['sbang_install_path'] = sbang.sbang_install_path()
buildinfo['relative_rpaths'] = rel
buildinfo['buildpath'] = spack.store.layout.root
buildinfo['spackprefix'] = spack.paths.prefix
@@ -1085,6 +1087,10 @@ def relocate_package(spec, allow_root):
new_prefix = str(spec.prefix)
new_rel_prefix = str(os.path.relpath(new_prefix, new_layout_root))
new_spack_prefix = str(spack.paths.prefix)
+
+ old_sbang_install_path = None
+ if 'sbang_install_path' in buildinfo:
+ old_sbang_install_path = str(buildinfo['sbang_install_path'])
old_layout_root = str(buildinfo['buildpath'])
old_spack_prefix = str(buildinfo.get('spackprefix'))
old_rel_prefix = buildinfo.get('relative_prefix')
@@ -1111,6 +1117,11 @@ def relocate_package(spec, allow_root):
# Hence 2 dictionaries are maintained here.
prefix_to_prefix_text = OrderedDict({})
prefix_to_prefix_bin = OrderedDict({})
+
+ if old_sbang_install_path:
+ import spack.hooks.sbang as sbang
+ prefix_to_prefix_text[old_sbang_install_path] = sbang.sbang_install_path()
+
prefix_to_prefix_text[old_prefix] = new_prefix
prefix_to_prefix_bin[old_prefix] = new_prefix
prefix_to_prefix_text[old_layout_root] = new_layout_root