diff options
author | George Hartzell <hartzell@alerce.com> | 2018-05-31 16:01:32 -0700 |
---|---|---|
committer | scheibelp <scheibel1@llnl.gov> | 2018-05-31 16:01:32 -0700 |
commit | a6867d5cd58b1194ce32a97bf215009ca68732ce (patch) | |
tree | 145561c7d1edf4d5c0d0ec0e2945b79fc590786b | |
parent | 59633d5c958883ebf1a738ad1b8cd36480043dbf (diff) | |
download | spack-a6867d5cd58b1194ce32a97bf215009ca68732ce.tar.gz spack-a6867d5cd58b1194ce32a97bf215009ca68732ce.tar.bz2 spack-a6867d5cd58b1194ce32a97bf215009ca68732ce.tar.xz spack-a6867d5cd58b1194ce32a97bf215009ca68732ce.zip |
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.
-rw-r--r-- | lib/spack/spack/relocate.py | 2 |
1 files changed, 2 insertions, 0 deletions
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: |