From 25cbb34579bacc704c7f17f691cb36bf8f08b17b Mon Sep 17 00:00:00 2001 From: Stephen Sachs Date: Wed, 19 Oct 2022 17:37:07 +0200 Subject: 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 --- lib/spack/spack/binary_distribution.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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. -- cgit v1.2.3-70-g09d2