From a6867d5cd58b1194ce32a97bf215009ca68732ce Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Thu, 31 May 2018 16:01:32 -0700 Subject: binary caching: skip check if old and new paths are identical (#8281) Fixes #8217 Trying to relocate a distribution when the new and old paths are equal leads to failure, because the test that ensures that no unrelocated bits are left over always fails. As an example, this occurs if a user installs a package, generates a binary with it using 'spack buildcache', uninstalls it, and then attempts to reinstall into the same spack installation using the generated binary package. This updates the relocation check to accept the presence of the old prefix in binaries if the package is being reinstalled into its original location. --- lib/spack/spack/relocate.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index f90556b7b1..9800718dff 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -355,6 +355,7 @@ def relocate_binary(path_names, old_dir, new_dir, allow_root): rpaths, deps, idpath, new_rpaths, new_deps, new_idpath) if (not allow_root and + old_dir != new_dir and strings_contains_installroot(path_name, old_dir)): raise InstallRootStringException(path_name, old_dir) @@ -373,6 +374,7 @@ def relocate_binary(path_names, old_dir, new_dir, allow_root): old_dir, new_dir) modify_elf_object(path_name, new_rpaths) if (not allow_root and + old_dir != new_dir and strings_contains_installroot(path_name, old_dir)): raise InstallRootStringException(path_name, old_dir) else: -- cgit v1.2.3-70-g09d2