From e81ce18cade3a9824e5c28cf78c99e3836241b4d Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Mon, 28 Oct 2024 19:28:03 -0700 Subject: cmd/solve: use interface from cmd/spec (#47182) Currently, `spack solve` has different spec selection semantics than `spack spec`. `spack solve` currently does not allow specifying a single spec when an environment is active. This PR modifies `spack solve` to inherit the interface from `spack spec`, and to use the same spec selection logic. This will allow for better use of `spack solve --show opt` for debugging. --------- Co-authored-by: Todd Gamblin --- share/spack/spack-completion.bash | 2 +- share/spack/spack-completion.fish | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'share') diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 52f8a9ea41..d8c58143c9 100644 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -1831,7 +1831,7 @@ _spack_restage() { _spack_solve() { if $list_options then - SPACK_COMPREPLY="-h --help --show -l --long -L --very-long -N --namespaces -I --install-status --no-install-status -y --yaml -j --json -c --cover -t --types --timers --stats -U --fresh --reuse --fresh-roots --reuse-deps --deprecated" + SPACK_COMPREPLY="-h --help --show --timers --stats -l --long -L --very-long -N --namespaces -I --install-status --no-install-status -y --yaml -j --json --format -c --cover -t --types -U --fresh --reuse --fresh-roots --reuse-deps --deprecated" else _all_packages fi diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index 84da6412f1..afea0b1a57 100644 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -2747,12 +2747,16 @@ complete -c spack -n '__fish_spack_using_command restage' -s h -l help -f -a hel complete -c spack -n '__fish_spack_using_command restage' -s h -l help -d 'show this help message and exit' # spack solve -set -g __fish_spack_optspecs_spack_solve h/help show= l/long L/very-long N/namespaces I/install-status no-install-status y/yaml j/json c/cover= t/types timers stats U/fresh reuse fresh-roots deprecated +set -g __fish_spack_optspecs_spack_solve h/help show= timers stats l/long L/very-long N/namespaces I/install-status no-install-status y/yaml j/json format= c/cover= t/types U/fresh reuse fresh-roots deprecated complete -c spack -n '__fish_spack_using_command_pos_remainder 0 solve' -f -k -a '(__fish_spack_specs_or_id)' complete -c spack -n '__fish_spack_using_command solve' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command solve' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command solve' -l show -r -f -a show complete -c spack -n '__fish_spack_using_command solve' -l show -r -d 'select outputs' +complete -c spack -n '__fish_spack_using_command solve' -l timers -f -a timers +complete -c spack -n '__fish_spack_using_command solve' -l timers -d 'print out timers for different solve phases' +complete -c spack -n '__fish_spack_using_command solve' -l stats -f -a stats +complete -c spack -n '__fish_spack_using_command solve' -l stats -d 'print out statistics from clingo' complete -c spack -n '__fish_spack_using_command solve' -s l -l long -f -a long complete -c spack -n '__fish_spack_using_command solve' -s l -l long -d 'show dependency hashes as well as versions' complete -c spack -n '__fish_spack_using_command solve' -s L -l very-long -f -a very_long @@ -2764,17 +2768,15 @@ complete -c spack -n '__fish_spack_using_command solve' -s I -l install-status - complete -c spack -n '__fish_spack_using_command solve' -l no-install-status -f -a install_status complete -c spack -n '__fish_spack_using_command solve' -l no-install-status -d 'do not show install status annotations' complete -c spack -n '__fish_spack_using_command solve' -s y -l yaml -f -a format -complete -c spack -n '__fish_spack_using_command solve' -s y -l yaml -d 'print concrete spec as yaml' +complete -c spack -n '__fish_spack_using_command solve' -s y -l yaml -d 'print concrete spec as YAML' complete -c spack -n '__fish_spack_using_command solve' -s j -l json -f -a format -complete -c spack -n '__fish_spack_using_command solve' -s j -l json -d 'print concrete spec as json' +complete -c spack -n '__fish_spack_using_command solve' -s j -l json -d 'print concrete spec as JSON' +complete -c spack -n '__fish_spack_using_command solve' -l format -r -f -a format +complete -c spack -n '__fish_spack_using_command solve' -l format -r -d 'print concrete spec with the specified format string' complete -c spack -n '__fish_spack_using_command solve' -s c -l cover -r -f -a 'nodes edges paths' complete -c spack -n '__fish_spack_using_command solve' -s c -l cover -r -d 'how extensively to traverse the DAG (default: nodes)' complete -c spack -n '__fish_spack_using_command solve' -s t -l types -f -a types complete -c spack -n '__fish_spack_using_command solve' -s t -l types -d 'show dependency types' -complete -c spack -n '__fish_spack_using_command solve' -l timers -f -a timers -complete -c spack -n '__fish_spack_using_command solve' -l timers -d 'print out timers for different solve phases' -complete -c spack -n '__fish_spack_using_command solve' -l stats -f -a stats -complete -c spack -n '__fish_spack_using_command solve' -l stats -d 'print out statistics from clingo' complete -c spack -n '__fish_spack_using_command solve' -s U -l fresh -f -a concretizer_reuse complete -c spack -n '__fish_spack_using_command solve' -s U -l fresh -d 'do not reuse installed deps; build newest configuration' complete -c spack -n '__fish_spack_using_command solve' -l reuse -f -a concretizer_reuse -- cgit v1.2.3-70-g09d2