summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-07-28 21:16:35 +0200
committerGitHub <noreply@github.com>2022-07-28 12:16:35 -0700
commite4f0f3582ea2a201f8f86bb360f38a00bdfe9264 (patch)
tree9c1771cd1367d38ac21145a9cbb89c5c48aac1c9
parente8cce0f7cbaa3ecf0b72fcce81d595df67580782 (diff)
downloadspack-e4f0f3582ea2a201f8f86bb360f38a00bdfe9264.tar.gz
spack-e4f0f3582ea2a201f8f86bb360f38a00bdfe9264.tar.bz2
spack-e4f0f3582ea2a201f8f86bb360f38a00bdfe9264.tar.xz
spack-e4f0f3582ea2a201f8f86bb360f38a00bdfe9264.zip
environment.py: only install root specs explicitly (#31645)
-rw-r--r--lib/spack/spack/cmd/install.py5
-rw-r--r--lib/spack/spack/environment/environment.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
index fe41316330..bda6850db0 100644
--- a/lib/spack/spack/cmd/install.py
+++ b/lib/spack/spack/cmd/install.py
@@ -131,8 +131,9 @@ which is useful for CI pipeline troubleshooting""")
help='(with environment) only install already concretized specs')
subparser.add_argument(
'--no-add', action='store_true', default=False,
- help="""(with environment) only install specs provided as argument
-if they are already in the concretized environment""")
+ help="""(with environment) partially install an environment, limiting
+to concrete specs in the environment matching the arguments.
+Non-roots remain installed implicitly.""")
subparser.add_argument(
'-f', '--file', action='append', default=[],
dest='specfiles', metavar='SPEC_YAML_FILE',
diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py
index ddfae0c783..83c33905aa 100644
--- a/lib/spack/spack/environment/environment.py
+++ b/lib/spack/spack/environment/environment.py
@@ -1643,7 +1643,9 @@ class Environment(object):
installs = []
for spec in specs_to_install:
- installs.append((spec.package, install_args))
+ pkg_install_args = install_args.copy()
+ pkg_install_args['explicit'] = spec in self.roots()
+ installs.append((spec.package, pkg_install_args))
try:
builder = PackageInstaller(installs)