When shared mode is active store installed packages in SPACK_PATH

This commit is contained in:
Carson Woods
2019-06-27 13:08:04 -06:00
parent 7e62e0f27f
commit 2d3b973ebc

View File

@@ -70,9 +70,13 @@ def reindex(self):
def _store():
"""Get the singleton store instance."""
root = spack.config.get('config:install_tree', default_root)
root = spack.util.path.canonicalize_path(root)
if spack.config.get('config:shared'):
root = os.path.join(os.environ["SPACK_PATH"], "opt/")
else:
root = spack.config.get('config:install_tree', default_root)
# Canonicalize Path for Root regardless of origin
root = spack.util.path.canonicalize_path(root)
return Store(root,
spack.config.get('config:install_path_scheme'),
spack.config.get('config:install_hash_length'))
@@ -88,7 +92,13 @@ def _store():
def retrieve_upstream_dbs():
other_spack_instances = spack.config.get('upstreams', {})
other_spack_instances = spack.config.get('upstreams')
if spack.config.get('config:shared'):
path = spack.util.path.canonicalize_path("$spack/opt/spack")
other_spack_instances.update({'spack-root':
{'install_tree': path}})
install_roots = []
for install_properties in other_spack_instances.values():