env: spack env install
automatically concretizes specs
This commit is contained in:
parent
d14f7b82bb
commit
3fd9fc8994
@ -353,14 +353,24 @@ def _env_concretize(env, use_repo=False, force=False):
|
||||
# env install
|
||||
#
|
||||
def env_install_setup_parser(subparser):
|
||||
"""install all concretized specs in an environment"""
|
||||
"""concretize and install all specs in an environment"""
|
||||
subparser.add_argument(
|
||||
'env', nargs='?', help='install all packages in this environment')
|
||||
subparser.add_argument(
|
||||
'--only-concrete', action='store_true', default=False,
|
||||
help='only install already concretized specs')
|
||||
spack.cmd.install.add_common_arguments(subparser)
|
||||
|
||||
|
||||
def env_install(args):
|
||||
env = get_env(args, 'status')
|
||||
|
||||
# concretize unless otherwise specified
|
||||
if not args.only_concrete:
|
||||
env.concretize()
|
||||
env.write()
|
||||
|
||||
# install all specs in the environment
|
||||
env.install(args)
|
||||
|
||||
|
||||
|
@ -425,9 +425,8 @@ def concretize(self, force=False):
|
||||
# return only the newly concretized specs
|
||||
return new_specs
|
||||
|
||||
def install(self, install_args=None):
|
||||
"""Do a `spack install` on all the (concretized)
|
||||
specs in an Environment."""
|
||||
def install(self, args=None):
|
||||
"""Install all concretized specs in an environment."""
|
||||
|
||||
# Make sure log directory exists
|
||||
logs_dir = log_path(self.dotenv_path)
|
||||
@ -439,8 +438,9 @@ def install(self, install_args=None):
|
||||
# Parse cli arguments and construct a dictionary
|
||||
# that will be passed to Package.do_install API
|
||||
kwargs = dict()
|
||||
if install_args:
|
||||
spack.cmd.install.update_kwargs_from_args(install_args, kwargs)
|
||||
if args:
|
||||
spack.cmd.install.update_kwargs_from_args(args, kwargs)
|
||||
|
||||
with fs.working_dir(self.path):
|
||||
spec.package.do_install(**kwargs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user