diff options
author | Greg Becker <becker33@llnl.gov> | 2023-11-10 14:55:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 14:55:35 -0800 |
commit | 13abfb7013ca282b06cf4069d96c3d7c093bc684 (patch) | |
tree | a5e485bc2775feb36438bde87b00c518b1811deb /share | |
parent | b41fc1ec79ee8ebcf439f3e3b9d18989274cc561 (diff) | |
download | spack-13abfb7013ca282b06cf4069d96c3d7c093bc684.tar.gz spack-13abfb7013ca282b06cf4069d96c3d7c093bc684.tar.bz2 spack-13abfb7013ca282b06cf4069d96c3d7c093bc684.tar.xz spack-13abfb7013ca282b06cf4069d96c3d7c093bc684.zip |
`spack deconcretize` command (#38803)
We have two ways to concretize now:
* `spack concretize` concretizes only the root specs that are not concrete in the environment.
* `spack concretize -f` eliminates all cached concretization data and reconcretizes the *entire* environment.
This PR adds `spack deconcretize`, which eliminates cached concretization data for a spec. This allows
users greater control over what is preserved from their `spack.lock` file and what is reused when not
using `spack concretize -f`. If you want to update a spec installed in your environment, you can call
`spack deconcretize` on it, and that spec and any relevant dependents will be removed from the lock file.
`spack concretize` has two options:
* `--root`: limits deconcretized specs to *specific* roots in the environment. You can use this to
deconcretize exactly one root in a `unify: false` environment. i.e., if `foo` root is a dependent
of `bar`, both roots, `spack deconcretize bar` will *not* deconcretize `foo`.
* `--all`: deconcretize *all* specs that match the input spec. By default `spack deconcretize`
will complain about multiple matches, like `spack uninstall`.
Diffstat (limited to 'share')
-rwxr-xr-x | share/spack/spack-completion.bash | 11 | ||||
-rwxr-xr-x | share/spack/spack-completion.fish | 13 |
2 files changed, 23 insertions, 1 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index e84fe10134..a54f7db414 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -401,7 +401,7 @@ _spack() { then SPACK_COMPREPLY="-h --help -H --all-help --color -c --config -C --config-scope -d --debug --timestamp --pdb -e --env -D --env-dir -E --no-env --use-env-repo -k --insecure -l --enable-locks -L --disable-locks -m --mock -b --bootstrap -p --profile --sorted-profile --lines -v --verbose --stacktrace --backtrace -V --version --print-shell-vars" else - SPACK_COMPREPLY="add arch audit blame bootstrap build-env buildcache cd change checksum ci clean clone commands compiler compilers concretize concretise config containerize containerise create debug dependencies dependents deprecate dev-build develop diff docs edit env extensions external fetch find gc gpg graph help info install license list load location log-parse maintainers make-installer mark mirror module patch pkg providers pydoc python reindex remove rm repo resource restage solve spec stage style tags test test-env tutorial undevelop uninstall unit-test unload url verify versions view" + SPACK_COMPREPLY="add arch audit blame bootstrap build-env buildcache cd change checksum ci clean clone commands compiler compilers concretize concretise config containerize containerise create debug deconcretize dependencies dependents deprecate dev-build develop diff docs edit env extensions external fetch find gc gpg graph help info install license list load location log-parse maintainers make-installer mark mirror module patch pkg providers pydoc python reindex remove rm repo resource restage solve spec stage style tags test test-env tutorial undevelop uninstall unit-test unload url verify versions view" fi } @@ -937,6 +937,15 @@ _spack_debug_report() { SPACK_COMPREPLY="-h --help" } +_spack_deconcretize() { + if $list_options + then + SPACK_COMPREPLY="-h --help --root -y --yes-to-all -a --all" + else + _all_packages + fi +} + _spack_dependencies() { if $list_options then diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index d660c251af..1029fa6b45 100755 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -371,6 +371,7 @@ complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a containerize -d ' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a containerise -d 'creates recipes to build images for different container runtimes' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a create -d 'create a new package file' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a debug -d 'debugging commands for troubleshooting Spack' +complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a deconcretize -d 'remove specs from the concretized lockfile of an environment' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a dependencies -d 'show dependencies of a package' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a dependents -d 'show packages that depend on another' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a deprecate -d 'replace one package with another via symlinks' @@ -1290,6 +1291,18 @@ set -g __fish_spack_optspecs_spack_debug_report h/help complete -c spack -n '__fish_spack_using_command debug report' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command debug report' -s h -l help -d 'show this help message and exit' +# spack deconcretize +set -g __fish_spack_optspecs_spack_deconcretize h/help root y/yes-to-all a/all +complete -c spack -n '__fish_spack_using_command_pos_remainder 0 deconcretize' -f -k -a '(__fish_spack_specs)' +complete -c spack -n '__fish_spack_using_command deconcretize' -s h -l help -f -a help +complete -c spack -n '__fish_spack_using_command deconcretize' -s h -l help -d 'show this help message and exit' +complete -c spack -n '__fish_spack_using_command deconcretize' -l root -f -a root +complete -c spack -n '__fish_spack_using_command deconcretize' -l root -d 'deconcretize only specific environment roots' +complete -c spack -n '__fish_spack_using_command deconcretize' -s y -l yes-to-all -f -a yes_to_all +complete -c spack -n '__fish_spack_using_command deconcretize' -s y -l yes-to-all -d 'assume "yes" is the answer to every confirmation request' +complete -c spack -n '__fish_spack_using_command deconcretize' -s a -l all -f -a all +complete -c spack -n '__fish_spack_using_command deconcretize' -s a -l all -d 'deconcretize ALL specs that match each supplied spec' + # spack dependencies set -g __fish_spack_optspecs_spack_dependencies h/help i/installed t/transitive deptype= V/no-expand-virtuals complete -c spack -n '__fish_spack_using_command_pos_remainder 0 dependencies' -f -k -a '(__fish_spack_specs)' |