When shared mode is active, set cache location to SPACK_PATH

This commit is contained in:
Carson Woods
2019-06-27 11:54:25 -06:00
parent 4f6916261c
commit 9e9adf1d2f

View File

@@ -40,7 +40,12 @@ def _fetch_cache():
This prevents Spack from repeatedly fetch the same files when
building the same package different ways or multiple times.
"""
if spack.config.get('config:shared'):
path = os.path.join(os.environ['SPACK_PATH'],
'var/spack/cache')
else:
path = spack.config.get('config:source_cache')
if not path:
path = os.path.join(spack.paths.var_path, "cache")
path = canonicalize_path(path)