diff options
author | Richarda Butler <39577672+RikkiButler20@users.noreply.github.com> | 2024-05-07 09:32:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 09:32:40 -0700 |
commit | be71f9fdc4ae85c4c9644447713ab0916a6348d4 (patch) | |
tree | 8a4a3ac6d70511d155536c28f693d96bc29b79d8 /share | |
parent | 05c1e7ecc22b873c3e534aef45774c88521fe7b3 (diff) | |
download | spack-be71f9fdc4ae85c4c9644447713ab0916a6348d4.tar.gz spack-be71f9fdc4ae85c4c9644447713ab0916a6348d4.tar.bz2 spack-be71f9fdc4ae85c4c9644447713ab0916a6348d4.tar.xz spack-be71f9fdc4ae85c4c9644447713ab0916a6348d4.zip |
Include concrete environments with `include_concrete` (#33768)
Add the ability to include any number of (potentially nested) concrete environments, e.g.:
```yaml
spack:
specs: []
concretizer:
unify: true
include_concrete:
- /path/to/environment1
- /path/to/environment2
```
or, from the CLI:
```console
$ spack env create myenv
$ spack -e myenv add python
$ spack -e myenv concretize
$ spack env create --include-concrete myenv included_env
```
The contents of included concrete environments' spack.lock files are
included in the environment's lock file at creation time. Any changes
to included concrete environments are only reflected after the environment
is re-concretized from the re-concretized included environments.
- [x] Concretize included envs
- [x] Save concrete specs in memory by hash
- [x] Add included envs to combined env's lock file
- [x] Add test
- [x] Update documentation
Co-authored-by: Kayla Butler <<butler59@llnl.gov>
Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.co
m>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Diffstat (limited to 'share')
-rwxr-xr-x | share/spack/spack-completion.bash | 6 | ||||
-rwxr-xr-x | share/spack/spack-completion.fish | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 387b364189..1f73849fc8 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -1052,7 +1052,7 @@ _spack_env_deactivate() { _spack_env_create() { if $list_options then - SPACK_COMPREPLY="-h --help -d --dir --keep-relative --without-view --with-view" + SPACK_COMPREPLY="-h --help -d --dir --keep-relative --without-view --with-view --include-concrete" else _environments fi @@ -1061,7 +1061,7 @@ _spack_env_create() { _spack_env_remove() { if $list_options then - SPACK_COMPREPLY="-h --help -y --yes-to-all" + SPACK_COMPREPLY="-h --help -y --yes-to-all -f --force" else _environments fi @@ -1070,7 +1070,7 @@ _spack_env_remove() { _spack_env_rm() { if $list_options then - SPACK_COMPREPLY="-h --help -y --yes-to-all" + SPACK_COMPREPLY="-h --help -y --yes-to-all -f --force" else _environments fi diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index 3818b12f1b..63abb4864e 100755 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -1538,7 +1538,7 @@ complete -c spack -n '__fish_spack_using_command env deactivate' -l pwsh -f -a s complete -c spack -n '__fish_spack_using_command env deactivate' -l pwsh -d 'print pwsh commands to activate the environment' # spack env create -set -g __fish_spack_optspecs_spack_env_create h/help d/dir keep-relative without-view with-view= +set -g __fish_spack_optspecs_spack_env_create h/help d/dir keep-relative without-view with-view= include-concrete= complete -c spack -n '__fish_spack_using_command_pos 0 env create' -f -a '(__fish_spack_environments)' complete -c spack -n '__fish_spack_using_command env create' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command env create' -s h -l help -d 'show this help message and exit' @@ -1550,22 +1550,28 @@ complete -c spack -n '__fish_spack_using_command env create' -l without-view -f complete -c spack -n '__fish_spack_using_command env create' -l without-view -d 'do not maintain a view for this environment' complete -c spack -n '__fish_spack_using_command env create' -l with-view -r -f -a with_view complete -c spack -n '__fish_spack_using_command env create' -l with-view -r -d 'specify that this environment should maintain a view at the specified path (by default the view is maintained in the environment directory)' +complete -c spack -n '__fish_spack_using_command env create' -l include-concrete -r -f -a include_concrete +complete -c spack -n '__fish_spack_using_command env create' -l include-concrete -r -d 'name of old environment to copy specs from' # spack env remove -set -g __fish_spack_optspecs_spack_env_remove h/help y/yes-to-all +set -g __fish_spack_optspecs_spack_env_remove h/help y/yes-to-all f/force complete -c spack -n '__fish_spack_using_command_pos_remainder 0 env remove' -f -a '(__fish_spack_environments)' complete -c spack -n '__fish_spack_using_command env remove' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command env remove' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command env remove' -s y -l yes-to-all -f -a yes_to_all complete -c spack -n '__fish_spack_using_command env remove' -s y -l yes-to-all -d 'assume "yes" is the answer to every confirmation request' +complete -c spack -n '__fish_spack_using_command env remove' -s f -l force -f -a force +complete -c spack -n '__fish_spack_using_command env remove' -s f -l force -d 'remove the environment even if it is included in another environment' # spack env rm -set -g __fish_spack_optspecs_spack_env_rm h/help y/yes-to-all +set -g __fish_spack_optspecs_spack_env_rm h/help y/yes-to-all f/force complete -c spack -n '__fish_spack_using_command_pos_remainder 0 env rm' -f -a '(__fish_spack_environments)' complete -c spack -n '__fish_spack_using_command env rm' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command env rm' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command env rm' -s y -l yes-to-all -f -a yes_to_all complete -c spack -n '__fish_spack_using_command env rm' -s y -l yes-to-all -d 'assume "yes" is the answer to every confirmation request' +complete -c spack -n '__fish_spack_using_command env rm' -s f -l force -f -a force +complete -c spack -n '__fish_spack_using_command env rm' -s f -l force -d 'remove the environment even if it is included in another environment' # spack env rename set -g __fish_spack_optspecs_spack_env_rename h/help d/dir f/force |