Compare commits
179 Commits
bugfix/msv
...
v0.15.1-sh
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2b05d2bf5c | ||
![]() |
cc00619929 | ||
![]() |
188a371595 | ||
![]() |
dce7be9932 | ||
![]() |
4bb26802ed | ||
![]() |
1965e1e606 | ||
![]() |
6ed3db6c14 | ||
![]() |
a8fbc96271 | ||
![]() |
d8956a3bbe | ||
![]() |
a807b95081 | ||
![]() |
1b608d6041 | ||
![]() |
be143d7dff | ||
![]() |
05fe92e086 | ||
![]() |
cd54fb95b8 | ||
![]() |
8b63c4555c | ||
![]() |
ec78160569 | ||
![]() |
e1379f132d | ||
![]() |
cdcd3dcedd | ||
![]() |
7c1083916a | ||
![]() |
c07bbe1a25 | ||
![]() |
85032c6224 | ||
![]() |
7b7898a69c | ||
![]() |
84c5d76eae | ||
![]() |
bcd47f0bd6 | ||
![]() |
cb6a959cdb | ||
![]() |
32cd12bff7 | ||
![]() |
7021965159 | ||
![]() |
5c5743ca33 | ||
![]() |
034a7662ac | ||
![]() |
e6b6ac5898 | ||
![]() |
35037bf088 | ||
![]() |
d14c245411 | ||
![]() |
6e2ad01f20 | ||
![]() |
ef9b5a8f74 | ||
![]() |
4921ed29d5 | ||
![]() |
f4c720e902 | ||
![]() |
0a71b1d5ac | ||
![]() |
3593a7be6a | ||
![]() |
e4d2cf4441 | ||
![]() |
911e51bd89 | ||
![]() |
6ec8aea6f7 | ||
![]() |
5b11f7aa4c | ||
![]() |
97e46981b9 | ||
![]() |
873ac5e890 | ||
![]() |
4d7dae5716 | ||
![]() |
b19f0fafcc | ||
![]() |
11b1bdd119 | ||
![]() |
f749821dc2 | ||
![]() |
5abb20dcab | ||
![]() |
0c233bdd0f | ||
![]() |
0f171c7ded | ||
![]() |
b4c7520dd8 | ||
![]() |
9ab7d8f01d | ||
![]() |
a7ad344c2a | ||
![]() |
deb2d3745c | ||
![]() |
ff96ec430b | ||
![]() |
d4a959736a | ||
![]() |
5ba51a0be0 | ||
![]() |
27e1140df7 | ||
![]() |
7ab6af8a3b | ||
![]() |
0e6e93eaac | ||
![]() |
38f8bdd2bb | ||
![]() |
8e45a3fc2f | ||
![]() |
c22af99b04 | ||
![]() |
fc3a909fbc | ||
![]() |
9665754eae | ||
![]() |
0f9f9f3a85 | ||
![]() |
777a5682a6 | ||
![]() |
8994b4aab6 | ||
![]() |
98ec366470 | ||
![]() |
c61f4d7c82 | ||
![]() |
811b304230 | ||
![]() |
8f0c9ad409 | ||
![]() |
6a423a5d8a | ||
![]() |
23c37063bd | ||
![]() |
478f3a5a99 | ||
![]() |
02afb30990 | ||
![]() |
06e3f15e47 | ||
![]() |
f13ce3540d | ||
![]() |
7ae34087e3 | ||
![]() |
f0fea97e88 | ||
![]() |
54893197ed | ||
![]() |
80da1d50d1 | ||
![]() |
944c5d75cd | ||
![]() |
9ef4bc9d50 | ||
![]() |
a2af432833 | ||
![]() |
aefed311af | ||
![]() |
6ffacddcf4 | ||
![]() |
e17824f82f | ||
![]() |
57ca47f035 | ||
![]() |
4532a56b4e | ||
![]() |
86e69a48a2 | ||
![]() |
2508295d81 | ||
![]() |
1a041c051a | ||
![]() |
2262ca2e67 | ||
![]() |
2269771a91 | ||
![]() |
7f32574dd8 | ||
![]() |
d15ac30f62 | ||
![]() |
1f41347ab8 | ||
![]() |
1f4f01103b | ||
![]() |
8f46fcb512 | ||
![]() |
2d3b973ebc | ||
![]() |
7e62e0f27f | ||
![]() |
ea0db4c0f9 | ||
![]() |
0afc68e60b | ||
![]() |
8ad25d5013 | ||
![]() |
e90db68321 | ||
![]() |
9e96b89f02 | ||
![]() |
b4dae1b7fd | ||
![]() |
9e9adf1d2f | ||
![]() |
de9255247a | ||
![]() |
de5d3e3229 | ||
![]() |
e621aafc77 | ||
![]() |
c53427c98d | ||
![]() |
7a75148d1b | ||
![]() |
4210520c9d | ||
![]() |
4f3fb50ae7 | ||
![]() |
7660659107 | ||
![]() |
fcca2a518b | ||
![]() |
23e1cd7775 | ||
![]() |
58e794e95a | ||
![]() |
7ed59ed835 | ||
![]() |
512726ae5b | ||
![]() |
20851a6e6c | ||
![]() |
92bbbb9659 | ||
![]() |
5f2f2bfb84 | ||
![]() |
9b63f72d6b | ||
![]() |
4c60f01bae | ||
![]() |
cd08308463 | ||
![]() |
fe69997043 | ||
![]() |
1584a6e3c6 | ||
![]() |
c393880852 | ||
![]() |
bbe9e6bf54 | ||
![]() |
d7a00b71d4 | ||
![]() |
6775d2546a | ||
![]() |
8a154333f2 | ||
![]() |
5e637a04fd | ||
![]() |
0213869439 | ||
![]() |
22e9a9792a | ||
![]() |
4f23da9d26 | ||
![]() |
f9430e2fd4 | ||
![]() |
a2f86d5d18 | ||
![]() |
0efab6637c | ||
![]() |
2b11694b94 | ||
![]() |
088798a727 | ||
![]() |
bddbb1c22e | ||
![]() |
92f447cf1c | ||
![]() |
96f266c3e3 | ||
![]() |
d5093c20c5 | ||
![]() |
2064241c37 | ||
![]() |
721742b764 | ||
![]() |
c45bf153d8 | ||
![]() |
b98e5e66e7 | ||
![]() |
3d18bf345f | ||
![]() |
f8e9cf4081 | ||
![]() |
98e0f8b89b | ||
![]() |
263275b7ea | ||
![]() |
3e13002d7f | ||
![]() |
654e5cc924 | ||
![]() |
04a72c1834 | ||
![]() |
53cf6eb194 | ||
![]() |
5a7f186176 | ||
![]() |
987adfa9c9 | ||
![]() |
e476bb1400 | ||
![]() |
dc12233610 | ||
![]() |
29d21a0a5d | ||
![]() |
762f505da5 | ||
![]() |
8e1c326174 | ||
![]() |
0bac5d527d | ||
![]() |
79256eeb5c | ||
![]() |
de760942f2 | ||
![]() |
860641bfab | ||
![]() |
673e55f14d | ||
![]() |
54777a4f3e | ||
![]() |
db36e66592 | ||
![]() |
0d36e94407 | ||
![]() |
92c3b5b8b2 | ||
![]() |
71220a3656 | ||
![]() |
09bd29d816 |
@@ -16,7 +16,7 @@
|
||||
config:
|
||||
# This is the path to the root of the Spack install tree.
|
||||
# You can use $spack here to refer to the root of the spack instance.
|
||||
install_tree: $spack/opt/spack
|
||||
install_tree: ~/.spack/opt/spack
|
||||
|
||||
|
||||
# Locations where templates should be found
|
||||
@@ -30,8 +30,8 @@ config:
|
||||
|
||||
# Locations where different types of modules should be installed.
|
||||
module_roots:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
tcl: ~/.spack/share/spack/modules
|
||||
lmod: ~/.spack/share/spack/lmod
|
||||
|
||||
|
||||
# Temporary locations Spack can try to use for builds.
|
||||
@@ -67,7 +67,7 @@ config:
|
||||
|
||||
# Cache directory for already downloaded source tarballs and archived
|
||||
# repositories. This can be purged with `spack clean --downloads`.
|
||||
source_cache: $spack/var/spack/cache
|
||||
source_cache: ~/.spack/var/spack/cache
|
||||
|
||||
|
||||
# Cache directory for miscellaneous files, like the package index.
|
||||
|
7
etc/spack/defaults/upstreams.yaml
Normal file
7
etc/spack/defaults/upstreams.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
upstreams:
|
||||
global:
|
||||
install_tree: $spack/opt/spack
|
||||
modules:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
dotkit: $spack/share/spack/dotkit
|
@@ -42,6 +42,7 @@ def _fetch_cache():
|
||||
building the same package different ways or multiple times.
|
||||
"""
|
||||
path = spack.config.get('config:source_cache')
|
||||
|
||||
if not path:
|
||||
path = os.path.join(spack.paths.var_path, "cache")
|
||||
path = spack.util.path.canonicalize_path(path)
|
||||
|
@@ -41,6 +41,8 @@ def update_kwargs_from_args(args, kwargs):
|
||||
'fake': args.fake,
|
||||
'dirty': args.dirty,
|
||||
'use_cache': args.use_cache,
|
||||
'install_global': args.install_global,
|
||||
'upstream': args.upstream,
|
||||
'cache_only': args.cache_only,
|
||||
'explicit': True, # Always true for install command
|
||||
'stop_at': args.until,
|
||||
@@ -127,6 +129,14 @@ def setup_parser(subparser):
|
||||
'-f', '--file', action='append', default=[],
|
||||
dest='specfiles', metavar='SPEC_YAML_FILE',
|
||||
help="install from file. Read specs to install from .yaml files")
|
||||
subparser.add_argument(
|
||||
'--upstream', action='store', default=None,
|
||||
dest='upstream', metavar='UPSTREAM_NAME',
|
||||
help='specify which upstream spack to install too')
|
||||
subparser.add_argument(
|
||||
'-g', '--global', action='store_true', default=False,
|
||||
dest='install_global',
|
||||
help='install package to globally accesible location')
|
||||
|
||||
cd_group = subparser.add_mutually_exclusive_group()
|
||||
arguments.add_common_arguments(cd_group, ['clean', 'dirty'])
|
||||
@@ -220,7 +230,10 @@ def default_log_file(spec):
|
||||
"""
|
||||
fmt = 'test-{x.name}-{x.version}-{hash}.xml'
|
||||
basename = fmt.format(x=spec, hash=spec.dag_hash())
|
||||
dirname = fs.os.path.join(spack.paths.var_path, 'junit-report')
|
||||
|
||||
dirname = fs.os.path.join(spack.paths.user_config_path,
|
||||
'var/spack',
|
||||
'junit-report')
|
||||
fs.mkdirp(dirname)
|
||||
return fs.os.path.join(dirname, basename)
|
||||
|
||||
@@ -231,6 +244,7 @@ def install_spec(cli_args, kwargs, abstract_spec, spec):
|
||||
try:
|
||||
# handle active environment, if any
|
||||
env = ev.get_env(cli_args, 'install')
|
||||
|
||||
if env:
|
||||
with env.write_transaction():
|
||||
concrete = env.concretize_and_add(
|
||||
@@ -241,6 +255,10 @@ def install_spec(cli_args, kwargs, abstract_spec, spec):
|
||||
env.regenerate_views()
|
||||
else:
|
||||
spec.package.do_install(**kwargs)
|
||||
spack.config.set('config:active_tree', '~/.spack/opt/spack',
|
||||
scope='user')
|
||||
spack.config.set('config:active_upstream', None,
|
||||
scope='user')
|
||||
|
||||
except spack.build_environment.InstallError as e:
|
||||
if cli_args.show_log_on_error:
|
||||
@@ -255,6 +273,30 @@ def install_spec(cli_args, kwargs, abstract_spec, spec):
|
||||
|
||||
|
||||
def install(parser, args, **kwargs):
|
||||
# Install Package to Global Upstream for multi-user use
|
||||
if args.install_global:
|
||||
spack.config.set('config:active_upstream', 'global',
|
||||
scope='user')
|
||||
global_root = spack.config.get('upstreams')
|
||||
global_root = global_root['global']['install_tree']
|
||||
global_root = spack.util.path.canonicalize_path(global_root)
|
||||
spack.config.set('config:active_tree', global_root,
|
||||
scope='user')
|
||||
elif args.upstream:
|
||||
if args.upstream not in spack.config.get('upstreams'):
|
||||
tty.die("specified upstream does not exist")
|
||||
spack.config.set('config:active_upstream', args.upstream,
|
||||
scope='user')
|
||||
root = spack.config.get('upstreams')
|
||||
root = root[args.upstream]['install_tree']
|
||||
root = spack.util.path.canonicalize_path(root)
|
||||
spack.config.set('config:active_tree', root, scope='user')
|
||||
else:
|
||||
spack.config.set('config:active_upstream', None,
|
||||
scope='user')
|
||||
spack.config.set('config:active_tree',
|
||||
spack.config.get('config:install_tree'),
|
||||
scope='user')
|
||||
if args.help_cdash:
|
||||
parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
|
@@ -5,6 +5,8 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import sys
|
||||
import itertools
|
||||
|
||||
@@ -15,6 +17,7 @@
|
||||
import spack.cmd.common.arguments as arguments
|
||||
import spack.repo
|
||||
import spack.store
|
||||
import spack.spec
|
||||
from spack.database import InstallStatuses
|
||||
|
||||
from llnl.util import tty
|
||||
@@ -63,8 +66,24 @@ def setup_parser(subparser):
|
||||
help="remove ALL installed packages that match each supplied spec"
|
||||
)
|
||||
|
||||
subparser.add_argument(
|
||||
'packages',
|
||||
nargs=argparse.REMAINDER,
|
||||
help="specs of packages to uninstall")
|
||||
|
||||
def find_matching_specs(env, specs, allow_multiple_matches=False, force=False):
|
||||
subparser.add_argument(
|
||||
'-u', '--upstream', action='store', default=None,
|
||||
dest='upstream', metavar='UPSTREAM_NAME',
|
||||
help='specify which upstream spack to uninstall from')
|
||||
|
||||
subparser.add_argument(
|
||||
'-g', '--global', action='store_true',
|
||||
dest='global_uninstall',
|
||||
help='uninstall packages installed to global upstream')
|
||||
|
||||
|
||||
def find_matching_specs(env, specs, allow_multiple_matches=False, force=False,
|
||||
upstream=None, global_uninstall=False):
|
||||
"""Returns a list of specs matching the not necessarily
|
||||
concretized specs given from cli
|
||||
|
||||
@@ -76,6 +95,35 @@ def find_matching_specs(env, specs, allow_multiple_matches=False, force=False):
|
||||
Return:
|
||||
list of specs
|
||||
"""
|
||||
if global_uninstall:
|
||||
spack.config.set('config:active_upstream', 'global',
|
||||
scope='user')
|
||||
global_root = spack.config.get('upstreams')
|
||||
global_root = global_root['global']['install_tree']
|
||||
global_root = spack.util.path.canonicalize_path(global_root)
|
||||
spack.config.set('config:active_tree', global_root,
|
||||
scope='user')
|
||||
elif upstream:
|
||||
if upstream not in spack.config.get('upstreams'):
|
||||
tty.die("specified upstream does not exist")
|
||||
spack.config.set('config:active_upstream', upstream,
|
||||
scope='user')
|
||||
root = spack.config.get('upstreams')
|
||||
root = root[upstream]['install_tree']
|
||||
root = spack.util.path.canonicalize_path(root)
|
||||
spack.config.set('config:active_tree', root, scope='user')
|
||||
else:
|
||||
spack.config.set('config:active_upstream', None,
|
||||
scope='user')
|
||||
for spec in specs:
|
||||
if isinstance(spec, spack.spec.Spec):
|
||||
spec_name = str(spec)
|
||||
spec_copy = (copy.deepcopy(spec))
|
||||
spec_copy.concretize()
|
||||
if spec_copy.package.installed_upstream:
|
||||
tty.warn("{0} is installed upstream".format(spec_name))
|
||||
tty.die("Use 'spack uninstall [--upstream upstream_name]'")
|
||||
|
||||
# constrain uninstall resolution to current environment if one is active
|
||||
hashes = env.all_hashes() if env else None
|
||||
|
||||
@@ -233,11 +281,25 @@ def do_uninstall(env, specs, force):
|
||||
for item in ready:
|
||||
item.do_uninstall(force=force)
|
||||
|
||||
# write any changes made to the active environment
|
||||
if env:
|
||||
env.write()
|
||||
|
||||
spack.config.set('config:active_tree',
|
||||
'~/.spack/opt/spack',
|
||||
scope='user')
|
||||
|
||||
spack.config.set('config:active_upstream', None,
|
||||
scope='user')
|
||||
|
||||
|
||||
def get_uninstall_list(args, specs, env):
|
||||
# Gets the list of installed specs that match the ones give via cli
|
||||
# args.all takes care of the case where '-a' is given in the cli
|
||||
uninstall_list = find_matching_specs(env, specs, args.all, args.force)
|
||||
uninstall_list = find_matching_specs(env, specs, args.all, args.force,
|
||||
upstream=args.upstream,
|
||||
global_uninstall=args.global_uninstall
|
||||
)
|
||||
|
||||
# Takes care of '-R'
|
||||
active_dpts, inactive_dpts = installed_dependents(uninstall_list, env)
|
||||
@@ -314,7 +376,7 @@ def uninstall_specs(args, specs):
|
||||
anything_to_do = set(uninstall_list).union(set(remove_list))
|
||||
|
||||
if not anything_to_do:
|
||||
tty.warn('There are no package to uninstall.')
|
||||
tty.warn('There are no packages to uninstall.')
|
||||
return
|
||||
|
||||
if not args.yes_to_all:
|
||||
|
@@ -365,7 +365,26 @@ def __init__(self, root, db_dir=None, upstream_dbs=None,
|
||||
tty.debug('PACKAGE LOCK TIMEOUT: {0}'.format(
|
||||
str(timeout_format_str)))
|
||||
|
||||
# Create .spack-db/index.json for global upstream it doesn't exist
|
||||
global_install_tree = spack.config.get(
|
||||
'upstreams')['global']['install_tree']
|
||||
global_install_tree = global_install_tree.replace(
|
||||
'$spack', spack.paths.prefix)
|
||||
if self.is_upstream:
|
||||
if global_install_tree in self._db_dir:
|
||||
if not os.path.isfile(self._index_path):
|
||||
f = open(self._index_path, "w+")
|
||||
database = {
|
||||
'database': {
|
||||
'installs': {},
|
||||
'version': str(_db_version)
|
||||
}
|
||||
}
|
||||
try:
|
||||
sjson.dump(database, f)
|
||||
except Exception as e:
|
||||
raise Exception(
|
||||
"error writing YAML database:", str(e))
|
||||
self.lock = ForbiddenLock()
|
||||
else:
|
||||
self.lock = lk.Lock(self._lock_path,
|
||||
@@ -1182,6 +1201,9 @@ def _remove(self, spec):
|
||||
rec.installed = False
|
||||
return rec.spec
|
||||
|
||||
if self.is_upstream:
|
||||
return rec.spec
|
||||
|
||||
del self._data[key]
|
||||
for dep in rec.spec.dependencies(_tracked_deps):
|
||||
# FIXME: the two lines below needs to be updated once #11983 is
|
||||
|
@@ -644,6 +644,7 @@ def shell_set(var, value):
|
||||
|
||||
other_spack_instances = spack.config.get(
|
||||
'upstreams') or {}
|
||||
|
||||
for install_properties in other_spack_instances.values():
|
||||
upstream_module_roots = install_properties.get('modules', {})
|
||||
upstream_module_roots = dict(
|
||||
|
@@ -215,9 +215,18 @@ def root_path(name):
|
||||
Returns:
|
||||
root folder for module file installation
|
||||
"""
|
||||
|
||||
# Root folders where the various module files should be written
|
||||
roots = spack.config.get('config:module_roots', {})
|
||||
path = roots.get(name, os.path.join(spack.paths.share_path, name))
|
||||
active_upstream = spack.config.get('config:active_upstream')
|
||||
if active_upstream is not None:
|
||||
# Installs module files to upstream share directory.
|
||||
# Extra logic is needed for determining this location.
|
||||
roots = spack.config.get('upstreams')[active_upstream]['modules']
|
||||
path = roots.get(name, os.path.join(spack.paths.user_share_path, name))
|
||||
else:
|
||||
# If no upstream is active install module file to user share directory.
|
||||
roots = spack.config.get('config:module_roots', {})
|
||||
path = roots.get(name, os.path.join(spack.paths.user_share_path, name))
|
||||
return spack.util.path.canonicalize_path(path)
|
||||
|
||||
|
||||
@@ -288,6 +297,7 @@ def read_module_indices():
|
||||
module_type_to_index = {}
|
||||
module_type_to_root = install_properties.get('modules', {})
|
||||
for module_type, root in module_type_to_root.items():
|
||||
root = spack.util.path.canonicalize_path(root)
|
||||
module_type_to_index[module_type] = read_module_index(root)
|
||||
module_indices.append(module_type_to_index)
|
||||
|
||||
|
@@ -16,6 +16,9 @@
|
||||
#: This file lives in $prefix/lib/spack/spack/__file__
|
||||
prefix = ancestor(__file__, 4)
|
||||
|
||||
#: User configuration location
|
||||
user_config_path = os.path.expanduser('~/.spack')
|
||||
|
||||
#: synonym for prefix
|
||||
spack_root = prefix
|
||||
|
||||
@@ -38,16 +41,16 @@
|
||||
test_path = os.path.join(module_path, "test")
|
||||
hooks_path = os.path.join(module_path, "hooks")
|
||||
var_path = os.path.join(prefix, "var", "spack")
|
||||
user_var_path = os.path.join(user_config_path, "var", "spack")
|
||||
stage_path = os.path.join(user_var_path, "stage")
|
||||
repos_path = os.path.join(var_path, "repos")
|
||||
share_path = os.path.join(prefix, "share", "spack")
|
||||
user_share_path = os.path.join(user_config_path, "share", "spack")
|
||||
|
||||
# Paths to built-in Spack repositories.
|
||||
packages_path = os.path.join(repos_path, "builtin")
|
||||
mock_packages_path = os.path.join(repos_path, "builtin.mock")
|
||||
|
||||
#: User configuration location
|
||||
user_config_path = os.path.expanduser('~/.spack')
|
||||
|
||||
|
||||
opt_path = os.path.join(prefix, "opt")
|
||||
etc_path = os.path.join(prefix, "etc")
|
||||
|
@@ -154,6 +154,7 @@ def get_stage_root():
|
||||
|
||||
if _stage_root is None:
|
||||
candidates = spack.config.get('config:build_stage')
|
||||
|
||||
if isinstance(candidates, string_types):
|
||||
candidates = [candidates]
|
||||
|
||||
|
@@ -34,7 +34,7 @@
|
||||
import spack.directory_layout
|
||||
|
||||
#: default installation root, relative to the Spack install path
|
||||
default_root = os.path.join(spack.paths.opt_path, 'spack')
|
||||
default_root = os.path.join(spack.paths.user_config_path, 'opt/spack')
|
||||
|
||||
|
||||
class Store(object):
|
||||
@@ -70,9 +70,10 @@ 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)
|
||||
root = spack.config.get('config:active_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,11 +89,19 @@ def _store():
|
||||
|
||||
|
||||
def retrieve_upstream_dbs():
|
||||
other_spack_instances = spack.config.get('upstreams', {})
|
||||
|
||||
global_fallback = {'global': {'install_tree': '$spack/opt/spack',
|
||||
'modules':
|
||||
{'tcl': '$spack/share/spack/modules',
|
||||
'lmod': '$spack/share/spack/lmod',
|
||||
'dotkit': '$spack/share/spack/dotkit'}}}
|
||||
|
||||
other_spack_instances = spack.config.get('upstreams',
|
||||
global_fallback)
|
||||
install_roots = []
|
||||
for install_properties in other_spack_instances.values():
|
||||
install_roots.append(install_properties['install_tree'])
|
||||
install_roots.append(spack.util.path.canonicalize_path(
|
||||
install_properties['install_tree']))
|
||||
|
||||
return _construct_upstream_dbs_from_install_roots(install_roots)
|
||||
|
||||
|
@@ -117,7 +117,7 @@ def test_uninstall_deprecated(mock_packages, mock_archive, mock_fetch,
|
||||
|
||||
non_deprecated = spack.store.db.query()
|
||||
|
||||
uninstall('-y', 'libelf@0.8.10')
|
||||
uninstall('-y', '-g', 'libelf@0.8.10')
|
||||
|
||||
assert spack.store.db.query() == spack.store.db.query(installed=any)
|
||||
assert spack.store.db.query() == non_deprecated
|
||||
|
@@ -55,6 +55,46 @@ def test_install_package_and_dependency(
|
||||
assert 'errors="0"' in content
|
||||
|
||||
|
||||
def test_global_install_package_and_dependency(
|
||||
tmpdir, mock_packages, mock_archive, mock_fetch, config,
|
||||
install_mockery):
|
||||
|
||||
with tmpdir.as_cwd():
|
||||
install('--global',
|
||||
'--log-format=junit',
|
||||
'--log-file=test.xml',
|
||||
'libdwarf')
|
||||
|
||||
files = tmpdir.listdir()
|
||||
filename = tmpdir.join('test.xml')
|
||||
assert filename in files
|
||||
|
||||
content = filename.open().read()
|
||||
assert 'tests="2"' in content
|
||||
assert 'failures="0"' in content
|
||||
assert 'errors="0"' in content
|
||||
|
||||
|
||||
def test_upstream_install_package_and_dependency(
|
||||
tmpdir, mock_packages, mock_archive, mock_fetch, config,
|
||||
install_mockery):
|
||||
|
||||
with tmpdir.as_cwd():
|
||||
install('--upstream=global',
|
||||
'--log-format=junit',
|
||||
'--log-file=test.xml',
|
||||
'libdwarf')
|
||||
|
||||
files = tmpdir.listdir()
|
||||
filename = tmpdir.join('test.xml')
|
||||
assert filename in files
|
||||
|
||||
content = filename.open().read()
|
||||
assert 'tests="2"' in content
|
||||
assert 'failures="0"' in content
|
||||
assert 'errors="0"' in content
|
||||
|
||||
|
||||
@pytest.mark.disable_clean_stage_check
|
||||
def test_install_runtests_notests(monkeypatch, mock_packages, install_mockery):
|
||||
def check(pkg):
|
||||
|
@@ -81,6 +81,41 @@ def test_force_uninstall_spec_with_ref_count_not_zero(
|
||||
|
||||
|
||||
@pytest.mark.db
|
||||
@pytest.mark.usefixtures('mutable_database')
|
||||
def test_global_recursive_uninstall():
|
||||
"""Test recursive uninstall from global upstream"""
|
||||
uninstall('-g', '-y', '-a', '--dependents', 'callpath')
|
||||
|
||||
all_specs = spack.store.layout.all_specs()
|
||||
assert len(all_specs) == 8
|
||||
# query specs with multiple configurations
|
||||
mpileaks_specs = [s for s in all_specs if s.satisfies('mpileaks')]
|
||||
callpath_specs = [s for s in all_specs if s.satisfies('callpath')]
|
||||
mpi_specs = [s for s in all_specs if s.satisfies('mpi')]
|
||||
|
||||
assert len(mpileaks_specs) == 0
|
||||
assert len(callpath_specs) == 0
|
||||
assert len(mpi_specs) == 3
|
||||
|
||||
|
||||
@pytest.mark.db
|
||||
@pytest.mark.usefixtures('mutable_database')
|
||||
def test_upstream_recursive_uninstall():
|
||||
"""Test recursive uninstall from specified upstream"""
|
||||
uninstall('--upstream=global', '-y', '-a', '--dependents', 'callpath')
|
||||
|
||||
all_specs = spack.store.layout.all_specs()
|
||||
assert len(all_specs) == 8
|
||||
# query specs with multiple configurations
|
||||
mpileaks_specs = [s for s in all_specs if s.satisfies('mpileaks')]
|
||||
callpath_specs = [s for s in all_specs if s.satisfies('callpath')]
|
||||
mpi_specs = [s for s in all_specs if s.satisfies('mpi')]
|
||||
|
||||
assert len(mpileaks_specs) == 0
|
||||
assert len(callpath_specs) == 0
|
||||
assert len(mpi_specs) == 3
|
||||
|
||||
|
||||
def test_force_uninstall_and_reinstall_by_hash(mutable_database):
|
||||
"""Test forced uninstall and reinstall of old specs."""
|
||||
# this is the spec to be removed
|
||||
|
@@ -1,5 +1,5 @@
|
||||
config:
|
||||
install_tree: $spack/opt/spack
|
||||
install_tree: ~/.spack/opt/spack
|
||||
template_dirs:
|
||||
- $spack/share/spack/templates
|
||||
- $spack/lib/spack/spack/test/data/templates
|
||||
@@ -7,7 +7,7 @@ config:
|
||||
build_stage:
|
||||
- $tempdir/$user/spack-stage
|
||||
- ~/.spack/stage
|
||||
source_cache: $spack/var/spack/cache
|
||||
source_cache: ~/.spack/var/spack/cache
|
||||
misc_cache: ~/.spack/cache
|
||||
verify_ssl: true
|
||||
checksum: true
|
||||
|
7
lib/spack/spack/test/data/config/upstreams.yaml
Normal file
7
lib/spack/spack/test/data/config/upstreams.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
upstreams:
|
||||
global:
|
||||
install_tree: $spack/opt/spack
|
||||
modules:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
dotkit: $spack/share/spack/dotkit
|
7
lib/spack/spack/test/data/upstreams.yaml
Normal file
7
lib/spack/spack/test/data/upstreams.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
upstreams:
|
||||
global:
|
||||
install_tree: $spack/opt/spack
|
||||
modules:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
dotkit: $spack/share/spack/dotkit
|
@@ -13,6 +13,7 @@
|
||||
import os
|
||||
import pytest
|
||||
import json
|
||||
import shutil
|
||||
try:
|
||||
import uuid
|
||||
_use_uuid = True
|
||||
@@ -48,6 +49,19 @@ def test_store(tmpdir):
|
||||
spack.store.store = real_store
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def test_global_db_initializtion():
|
||||
global_store = spack.store.store
|
||||
global_db_path = '$spack/opt/spack'
|
||||
global_db_path = spack.util.path.canonicalize_path(global_db_path)
|
||||
shutil.rmtree(os.path.join(global_db_path, '.spack-db'))
|
||||
global_store = spack.store.Store(str(global_db_path))
|
||||
|
||||
yield
|
||||
|
||||
spack.store.store = global_store
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def upstream_and_downstream_db(tmpdir_factory, gen_mock_layout):
|
||||
mock_db_root = str(tmpdir_factory.mktemp('mock_db_root'))
|
||||
|
@@ -962,7 +962,7 @@ _spack_info() {
|
||||
_spack_install() {
|
||||
if $list_options
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --no-check-signature --show-log-on-error --source -n --no-checksum -v --verbose --fake --only-concrete -f --file --clean --dirty --test --run-tests --log-format --log-file --help-cdash --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp -y --yes-to-all"
|
||||
SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --no-check-signature --show-log-on-error --source -n --no-checksum -v --verbose --fake --only-concrete -f --file --upstream -g --global --clean --dirty --test --run-tests --log-format --log-file --help-cdash --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp -y --yes-to-all"
|
||||
else
|
||||
_all_packages
|
||||
fi
|
||||
@@ -1436,7 +1436,7 @@ _spack_test() {
|
||||
_spack_uninstall() {
|
||||
if $list_options
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help -f --force -R --dependents -y --yes-to-all -a --all"
|
||||
SPACK_COMPREPLY="-h --help -f --force -R --dependents -y --yes-to-all -a --all -u --upstream -g --global"
|
||||
else
|
||||
_installed_packages
|
||||
fi
|
||||
|
Reference in New Issue
Block a user