summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2019-11-15 13:55:51 -0800
committerGitHub <noreply@github.com>2019-11-15 13:55:51 -0800
commitaa83c483f7dde76e590f53b69992e1afa84476db (patch)
treeda524798461a60c3b3363475659fd0c99d0e913a /lib
parent46bfcbbd3d0a3bec635d7bf80b6b3e9d0e4fae59 (diff)
downloadspack-aa83c483f7dde76e590f53b69992e1afa84476db.tar.gz
spack-aa83c483f7dde76e590f53b69992e1afa84476db.tar.bz2
spack-aa83c483f7dde76e590f53b69992e1afa84476db.tar.xz
spack-aa83c483f7dde76e590f53b69992e1afa84476db.zip
Bugfix/config caching 13754 (#13759)
* remove reference to `spack.store` in method definition Referencing `spack.store` in method definition will cache the `spack.config.config` singleton variable too early, before we have a chance to add command line and environment scopes.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/relocate.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py
index 744338d7e5..434d681035 100644
--- a/lib/spack/spack/relocate.py
+++ b/lib/spack/spack/relocate.py
@@ -637,8 +637,7 @@ def is_relocatable(spec):
return True
-def file_is_relocatable(
- file, paths_to_relocate=[spack.store.layout.root, spack.paths.prefix]):
+def file_is_relocatable(file, paths_to_relocate=None):
"""Returns True if the file passed as argument is relocatable.
Args:
@@ -651,6 +650,8 @@ def file_is_relocatable(
ValueError: if the file does not exist or the path is not absolute
"""
+ default_paths_to_relocate = [spack.store.layout.root, spack.paths.prefix]
+ paths_to_relocate = paths_to_relocate or default_paths_to_relocate
if not (platform.system().lower() == 'darwin'
or platform.system().lower() == 'linux'):