diff options
author | Stephen Sachs <stephenmsachs@gmail.com> | 2022-10-19 17:37:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 17:37:07 +0200 |
commit | 25cbb34579bacc704c7f17f691cb36bf8f08b17b (patch) | |
tree | 6e18f4df6166b1f3084b43fed03436310c52c5c7 /lib | |
parent | a423dc646ac932d3d5bfe79c53a1e934bf36227c (diff) | |
download | spack-25cbb34579bacc704c7f17f691cb36bf8f08b17b.tar.gz spack-25cbb34579bacc704c7f17f691cb36bf8f08b17b.tar.bz2 spack-25cbb34579bacc704c7f17f691cb36bf8f08b17b.tar.xz spack-25cbb34579bacc704c7f17f691cb36bf8f08b17b.zip |
Relocate "run" type dependencies too (#33191)
When downloading from binary cache not only replace RPATHs to dependencies, but
also text references to dependencies.
Example:
`autoconf@2.69` contains a text reference to the executable of its dependency
`perl`:
```
$ grep perl-5 /shared/spack/opt/spack/linux-amzn2-x86_64_v3/gcc-7.3.1/autoconf-2.69-q3lo/bin/autoreconf
eval 'case $# in 0) exec /shared/spack/opt/spack/linux-amzn2-x86_64_v3/gcc-7.3.1/perl-5.34.1-yphg/bin/perl -S "$0";; *) exec /shared/spack/opt/spack/linux-amzn2-x86_64_v3/gcc-7.3.1/perl-5.34.1-yphg/bin/perl -S "$0" "$@";; esac'
```
These references need to be replace or any package using `autoreconf` will fail
as it cannot find the installed `perl`.
Co-authored-by: Stephen Sachs <stesachs@amazon.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/binary_distribution.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index cfd7d0ec1b..b712e82cc0 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -721,7 +721,7 @@ def write_buildinfo_file(spec, workdir, rel=False): prefix_to_hash = dict() prefix_to_hash[str(spec.package.prefix)] = spec.dag_hash() deps = spack.build_environment.get_rpath_deps(spec.package) - for d in deps: + for d in deps + spec.dependencies(deptype="run"): prefix_to_hash[str(d.prefix)] = d.dag_hash() # Create buildinfo data and write it to disk @@ -1474,7 +1474,7 @@ def relocate_package(spec, allow_root): hash_to_prefix = dict() hash_to_prefix[spec.format("{hash}")] = str(spec.package.prefix) new_deps = spack.build_environment.get_rpath_deps(spec.package) - for d in new_deps: + for d in new_deps + spec.dependencies(deptype="run"): hash_to_prefix[d.format("{hash}")] = str(d.prefix) # Spurious replacements (e.g. sbang) will cause issues with binaries # For example, the new sbang can be longer than the old one. |