From 1ab888cdc1b0a42c9d855aacc0bacab6d7efb788 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 31 Oct 2022 10:41:59 +0100 Subject: remove sequential filter in binary relo (#33608) Currently there's a slow sequential step in binary relocation where all strings of a binary are collected, with rpaths removed, and then filtered for the old install root. This is completely unnecessary, and also incorrect, since we replace more than just the old install root in the prefix to prefix mapping. And in fact the prefix to prefix mapping is parallel, and a single pass. So even as an optimization, this filter makes no sense anymore. Therefor we remove it --- lib/spack/spack/binary_distribution.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index 7c62c58cb1..68b270c390 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -1644,27 +1644,15 @@ def relocate_package(spec, allow_root): old_prefix, new_prefix, ) - # Relocate links to the new install prefix - links = [link for link in buildinfo.get("relocate_links", [])] - relocate.relocate_links(links, old_layout_root, old_prefix, new_prefix) + + # Relocate links to the new install prefix + links = [link for link in buildinfo.get("relocate_links", [])] + relocate.relocate_links(links, old_layout_root, old_prefix, new_prefix) # For all buildcaches # relocate the install prefixes in text files including dependencies relocate.unsafe_relocate_text(text_names, prefix_to_prefix_text) - 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.unsafe_relocate_text_bin(files_to_relocate, prefix_to_prefix_bin) -- cgit v1.2.3-60-g2f50