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
|
# env install
|
||||||
#
|
#
|
||||||
def env_install_setup_parser(subparser):
|
def env_install_setup_parser(subparser):
|
||||||
"""install all concretized specs in an environment"""
|
"""concretize and install all specs in an environment"""
|
||||||
subparser.add_argument(
|
subparser.add_argument(
|
||||||
'env', nargs='?', help='install all packages in this environment')
|
'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)
|
spack.cmd.install.add_common_arguments(subparser)
|
||||||
|
|
||||||
|
|
||||||
def env_install(args):
|
def env_install(args):
|
||||||
env = get_env(args, 'status')
|
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)
|
env.install(args)
|
||||||
|
|
||||||
|
|
||||||
|
@ -425,9 +425,8 @@ def concretize(self, force=False):
|
|||||||
# return only the newly concretized specs
|
# return only the newly concretized specs
|
||||||
return new_specs
|
return new_specs
|
||||||
|
|
||||||
def install(self, install_args=None):
|
def install(self, args=None):
|
||||||
"""Do a `spack install` on all the (concretized)
|
"""Install all concretized specs in an environment."""
|
||||||
specs in an Environment."""
|
|
||||||
|
|
||||||
# Make sure log directory exists
|
# Make sure log directory exists
|
||||||
logs_dir = log_path(self.dotenv_path)
|
logs_dir = log_path(self.dotenv_path)
|
||||||
@ -439,8 +438,9 @@ def install(self, install_args=None):
|
|||||||
# Parse cli arguments and construct a dictionary
|
# Parse cli arguments and construct a dictionary
|
||||||
# that will be passed to Package.do_install API
|
# that will be passed to Package.do_install API
|
||||||
kwargs = dict()
|
kwargs = dict()
|
||||||
if install_args:
|
if args:
|
||||||
spack.cmd.install.update_kwargs_from_args(install_args, kwargs)
|
spack.cmd.install.update_kwargs_from_args(args, kwargs)
|
||||||
|
|
||||||
with fs.working_dir(self.path):
|
with fs.working_dir(self.path):
|
||||||
spec.package.do_install(**kwargs)
|
spec.package.do_install(**kwargs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user