diff options
author | eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> | 2021-01-20 12:43:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 12:43:07 -0800 |
commit | 7f86cc87b0cd3d96c5f6b518b7e13618c4db13fb (patch) | |
tree | f9f17867a00f213132cee47892271778936d34c4 /lib | |
parent | bef250535a0499152ee868d87ac824d85499a68a (diff) | |
download | spack-7f86cc87b0cd3d96c5f6b518b7e13618c4db13fb.tar.gz spack-7f86cc87b0cd3d96c5f6b518b7e13618c4db13fb.tar.bz2 spack-7f86cc87b0cd3d96c5f6b518b7e13618c4db13fb.tar.xz spack-7f86cc87b0cd3d96c5f6b518b7e13618c4db13fb.zip |
store sbang_install_path in buildinfo, use for subsequent relocation (#20768)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/binary_distribution.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index ebf2f314e5..694b323716 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 |