From 8eb4354b4b5c08a25a88fdb2f90e820139d1f5b4 Mon Sep 17 00:00:00 2001 From: psakiev Date: Tue, 12 Nov 2024 17:32:28 -0700 Subject: [PATCH] Add navigation to dive feature --- etc/spack/defaults/config.yaml | 2 +- lib/spack/spack/cmd/build_env.py | 4 +- lib/spack/spack/cmd/common/env_utility.py | 17 +++- lib/spack/spack/cmd/location.py | 50 +++++----- lib/spack/spack/util/shell_detection.py | 7 +- share/spack/spack-completion.bash | 12 +-- share/spack/spack-completion.fish | 116 ++++++++++++---------- 7 files changed, 112 insertions(+), 96 deletions(-) diff --git a/etc/spack/defaults/config.yaml b/etc/spack/defaults/config.yaml index 0064870fbe7..9f7c87a56f8 100644 --- a/etc/spack/defaults/config.yaml +++ b/etc/spack/defaults/config.yaml @@ -220,4 +220,4 @@ config: concretise: concretize containerise: containerize rm: remove - build-env-dive: build-env --dive + dev-dive: build-env --cd build-dir --dive diff --git a/lib/spack/spack/cmd/build_env.py b/lib/spack/spack/cmd/build_env.py index 96623affa35..c5d32056ccd 100644 --- a/lib/spack/spack/cmd/build_env.py +++ b/lib/spack/spack/cmd/build_env.py @@ -6,7 +6,7 @@ from spack.context import Context description = ( - "run a command in a spec's build environment, or dump its environment to screen or file" + "use a spec's build environment to run a command, dump to screen or file, or dive into it" ) section = "build" level = "long" @@ -14,7 +14,5 @@ setup_parser = env_utility.setup_parser -# TODO create a dropin/dive funciton that dev_build and build_env cmd's can use -# create a default shell utility for picking the current shell to start with def build_env(parser, args): env_utility.emulate_env_utility("build-env", Context.BUILD, args) diff --git a/lib/spack/spack/cmd/common/env_utility.py b/lib/spack/spack/cmd/common/env_utility.py index 82379c47a15..eba4d5661b2 100644 --- a/lib/spack/spack/cmd/common/env_utility.py +++ b/lib/spack/spack/cmd/common/env_utility.py @@ -15,6 +15,7 @@ import spack.store from spack import build_environment, traverse from spack.cmd.common import arguments +from spack.cmd.location import location_emulator from spack.context import Context from spack.util.environment import dump_environment, pickle_environment from spack.util.shell_detection import active_shell_type @@ -31,6 +32,11 @@ def setup_parser(subparser): subparser.add_argument( "-d", "--dive", action="store_true", help="dive into the build-env in a subshell" ) + subparser.add_argument( + "-c", + "--cd", + help="location to dive to or run command from (takes arguments from 'spack cd')", + ) subparser.add_argument( "--status", action="store_true", help="check shell for an active build environment" ) @@ -84,12 +90,19 @@ def neighbors(self, item): def run_command_in_subshell( - spec, context, cmd, prompt=False, dirty=False, shell=active_shell_type() + spec, context, cmd, prompt=False, dirty=False, cd_arg=None, shell=active_shell_type() ): mods = build_environment.setup_package(spec.package, dirty, context) + if prompt: mods.extend(spack.prompt.prompt_modifications(f"{spec.name}-{str(context)}-env", shell)) mods.apply_modifications() + + if cd_arg: + prefix = "-" if len(cd_arg) == 1 else "--" + location = location_emulator(f"{prefix}{cd_arg}", f"/{spec.dag_hash()}") + os.chdir(location) + os.execvp(cmd[0], cmd) @@ -157,7 +170,7 @@ def emulate_env_utility(cmd_name, context: Context, args): ) if cmd: - run_command_in_subshell(spec, context, cmd, prompt=args.dive) + run_command_in_subshell(spec, context, cmd, prompt=args.dive, cd_arg=args.cd) else: # setup build env if no command to run build_environment.setup_package(spec.package, args.dirty, context) diff --git a/lib/spack/spack/cmd/location.py b/lib/spack/spack/cmd/location.py index d7747846226..3deee4116a2 100644 --- a/lib/spack/spack/cmd/location.py +++ b/lib/spack/spack/cmd/location.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import argparse import os import llnl.util.tty as tty @@ -15,7 +16,7 @@ import spack.stage from spack.cmd.common import arguments -description = "print out locations of packages and spack directories" +description = "location = str out locations of packages and spack directories" section = "basic" level = "long" @@ -86,15 +87,11 @@ def setup_parser(subparser): arguments.add_common_arguments(subparser, ["spec"]) -def location(parser, args): +def _location(parser, args): if args.module_dir: - print(spack.paths.module_path) - return - + return spack.paths.module_path if args.spack_root: - print(spack.paths.prefix) - return - + return spack.paths.prefix # no -e corresponds to False, -e without arg to None, -e name to the string name. if args.location_env is not False: if args.location_env is None: @@ -106,16 +103,13 @@ def location(parser, args): if not ev.exists(args.location_env): tty.die("no such environment: '%s'" % args.location_env) path = ev.root(args.location_env) - print(path) - return + return path if args.packages: - print(spack.repo.PATH.first_repo().root) - return + return spack.repo.PATH.first_repo().root if args.stages: - print(spack.stage.get_stage_root()) - return + return spack.stage.get_stage_root() specs = spack.cmd.parse_specs(args.spec) @@ -129,15 +123,13 @@ def location(parser, args): if args.install_dir: env = ev.active_environment() spec = spack.cmd.disambiguate_spec(specs[0], env, first=args.find_first) - print(spec.prefix) - return + return spec.prefix spec = specs[0] # Package dir just needs the spec name if args.package_dir: - print(spack.repo.PATH.dirname_for_package_name(spec.name)) - return + return spack.repo.PATH.dirname_for_package_name(spec.name) # Either concretize or filter from already concretized environment spec = spack.cmd.matching_spec_from_env(spec) @@ -145,20 +137,17 @@ def location(parser, args): builder = spack.builder.create(pkg) if args.stage_dir: - print(pkg.stage.path) - return + return pkg.stage.path if args.build_dir: # Out of source builds have build_directory defined if hasattr(builder, "build_directory"): # build_directory can be either absolute or relative to the stage path # in either case os.path.join makes it absolute - print(os.path.normpath(os.path.join(pkg.stage.path, builder.build_directory))) - return + return os.path.normpath(os.path.join(pkg.stage.path, builder.build_directory)) # Otherwise assume in-source builds - print(pkg.stage.source_path) - return + return pkg.stage.source_path # source dir remains, which requires the spec to be staged if not pkg.stage.expanded: @@ -168,4 +157,15 @@ def location(parser, args): ) # Default to source dir. - print(pkg.stage.source_path) + return pkg.stage.source_path + + +# Is this too hacky? I don't want to reproduce the parser for an internal function +def location_emulator(*args): + parser = argparse.ArgumentParser() + setup_parser(parser) + return _location(parser, parser.parse_args(args)) + + +def location(parser, args): + print(_location(parser, args)) diff --git a/lib/spack/spack/util/shell_detection.py b/lib/spack/spack/util/shell_detection.py index a6d6062e6a5..817bb3c4865 100644 --- a/lib/spack/spack/util/shell_detection.py +++ b/lib/spack/spack/util/shell_detection.py @@ -16,10 +16,8 @@ def active_shell_type(env=os.environ): return "ps1" else: try: - output = subprocess.run( + output = subprocess.check_output( 'powershell -Command "echo $PSVersionTable"', - shell=True, - check=True, universal_newlines=True, ) if "PSVersion" in output: @@ -34,4 +32,5 @@ def active_shell_type(env=os.environ): if shell: return shell else: - raise SpackError("No shell type detected for the Unix process") + # assume it is a bourne shell + return "sh" diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 1346474c6eb..a82612c94f5 100644 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -393,7 +393,7 @@ _spack_compress_aliases() { # Spack commands # # Everything below here is auto-generated. -SPACK_ALIASES="concretise:concretize;containerise:containerize;rm:remove;build-env-dive:build-env --dive" +SPACK_ALIASES="concretise:concretize;containerise:containerize;rm:remove;dev-dive:build-env --cd build-dir --dive" _spack() { @@ -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 -t --backtrace -V --version --print-shell-vars" else - SPACK_COMPREPLY="add arch audit blame bootstrap build-env build-env-dive 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 logs 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 dev-dive 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 logs 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 } @@ -553,16 +553,16 @@ _spack_bootstrap_mirror() { _spack_build_env() { if $list_options then - SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive --status" + SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive -c --cd --status" else _all_packages fi } -_spack_build_env_dive() { +_spack_dev_dive() { if $list_options then - SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive --status" + SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive -c --cd --status" else _all_packages fi @@ -1966,7 +1966,7 @@ _spack_test_remove() { _spack_test_env() { if $list_options then - SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive --status" + SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive -c --cd --status" else _all_packages fi diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index 70920652deb..4b12a875f09 100644 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -353,8 +353,8 @@ complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a arch -d 'print ar complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a audit -d 'audit configuration files, packages, etc.' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a blame -d 'show contributors to packages' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a bootstrap -d 'manage bootstrap configuration' -complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a build-env -d 'run a command in a spec'"'"'s build environment, or dump its environment to screen or file' -complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a build-env-dive -d 'run a command in a spec'"'"'s build environment, or dump its environment to screen or file' +complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a build-env -d 'use a spec'"'"'s build environment to run a command, dump to screen or file, or dive into it' +complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a dev-dive -d 'use a spec'"'"'s build environment to run a command, dump to screen or file, or dive into it' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a buildcache -d 'create, download and install binary packages' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a cd -d 'cd to spack directories in the shell' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a change -d 'change an existing spec in an environment' @@ -395,7 +395,7 @@ complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a install -d 'build complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a license -d 'list and check license headers on files in spack' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a list -d 'list and search available packages' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a load -d 'add package to the user environment' -complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a location -d 'print out locations of packages and spack directories' +complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a location -d 'location = str out locations of packages and spack directories' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a log-parse -d 'filter errors and warnings from build logs' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a logs -d 'print out logs for packages' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a maintainers -d 'get information about package maintainers' @@ -604,7 +604,7 @@ set -g __fish_spack_optspecs_spack_bootstrap_enable h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 bootstrap enable' -f -a '(__fish_spack_bootstrap_names)' complete -c spack -n '__fish_spack_using_command bootstrap enable' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command bootstrap enable' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command bootstrap enable' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command bootstrap enable' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command bootstrap enable' -l scope -r -d 'configuration scope to read/modify' # spack bootstrap disable @@ -612,7 +612,7 @@ set -g __fish_spack_optspecs_spack_bootstrap_disable h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 bootstrap disable' -f -a '(__fish_spack_bootstrap_names)' complete -c spack -n '__fish_spack_using_command bootstrap disable' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command bootstrap disable' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command bootstrap disable' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command bootstrap disable' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command bootstrap disable' -l scope -r -d 'configuration scope to read/modify' # spack bootstrap reset @@ -627,14 +627,14 @@ set -g __fish_spack_optspecs_spack_bootstrap_root h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 bootstrap root' -f -a '(__fish_complete_directories)' complete -c spack -n '__fish_spack_using_command bootstrap root' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command bootstrap root' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command bootstrap root' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command bootstrap root' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command bootstrap root' -l scope -r -d 'configuration scope to read/modify' # spack bootstrap list set -g __fish_spack_optspecs_spack_bootstrap_list h/help scope= complete -c spack -n '__fish_spack_using_command bootstrap list' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command bootstrap list' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command bootstrap list' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command bootstrap list' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command bootstrap list' -l scope -r -d 'configuration scope to read/modify' # spack bootstrap add @@ -643,7 +643,7 @@ complete -c spack -n '__fish_spack_using_command_pos 0 bootstrap add' -f -a '(__ complete -c spack -n '__fish_spack_using_command_pos 1 bootstrap add' -f -a '(__fish_spack_environments)' complete -c spack -n '__fish_spack_using_command bootstrap add' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command bootstrap add' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command bootstrap add' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command bootstrap add' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command bootstrap add' -l scope -r -d 'configuration scope to read/modify' complete -c spack -n '__fish_spack_using_command bootstrap add' -l trust -f -a trust complete -c spack -n '__fish_spack_using_command bootstrap add' -l trust -d 'enable the source immediately upon addition' @@ -665,7 +665,7 @@ complete -c spack -n '__fish_spack_using_command bootstrap mirror' -l dev -f -a complete -c spack -n '__fish_spack_using_command bootstrap mirror' -l dev -d 'download dev dependencies too' # spack build-env -set -g __fish_spack_optspecs_spack_build_env h/help clean dirty U/fresh reuse fresh-roots deprecated dump= pickle= d/dive status +set -g __fish_spack_optspecs_spack_build_env h/help clean dirty U/fresh reuse fresh-roots deprecated dump= pickle= d/dive c/cd= status complete -c spack -n '__fish_spack_using_command_pos_remainder 0 build-env' -f -a '(__fish_spack_build_env_spec)' complete -c spack -n '__fish_spack_using_command build-env' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command build-env' -s h -l help -d 'show this help message and exit' @@ -687,34 +687,38 @@ complete -c spack -n '__fish_spack_using_command build-env' -l pickle -r -f -a p complete -c spack -n '__fish_spack_using_command build-env' -l pickle -r -d 'dump a pickled source-able environment to FILE' complete -c spack -n '__fish_spack_using_command build-env' -s d -l dive -f -a dive complete -c spack -n '__fish_spack_using_command build-env' -s d -l dive -d 'dive into the build-env in a subshell' +complete -c spack -n '__fish_spack_using_command build-env' -s c -l cd -r -f -a cd +complete -c spack -n '__fish_spack_using_command build-env' -s c -l cd -r -d 'location to dive to or run command from (takes arguments from '"'"'spack cd'"'"')' complete -c spack -n '__fish_spack_using_command build-env' -l status -f -a status complete -c spack -n '__fish_spack_using_command build-env' -l status -d 'check shell for an active build environment' -# spack build-env-dive -set -g __fish_spack_optspecs_spack_build_env_dive h/help clean dirty U/fresh reuse fresh-roots deprecated dump= pickle= d/dive status -complete -c spack -n '__fish_spack_using_command_pos_remainder 0 build-env-dive' -f -a '(__fish_spack_build_env_spec)' -complete -c spack -n '__fish_spack_using_command build-env-dive' -s h -l help -f -a help -complete -c spack -n '__fish_spack_using_command build-env-dive' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command build-env-dive' -l clean -f -a dirty -complete -c spack -n '__fish_spack_using_command build-env-dive' -l clean -d 'unset harmful variables in the build environment (default)' -complete -c spack -n '__fish_spack_using_command build-env-dive' -l dirty -f -a dirty -complete -c spack -n '__fish_spack_using_command build-env-dive' -l dirty -d 'preserve user environment in spack'"'"'s build environment (danger!)' -complete -c spack -n '__fish_spack_using_command build-env-dive' -s U -l fresh -f -a concretizer_reuse -complete -c spack -n '__fish_spack_using_command build-env-dive' -s U -l fresh -d 'do not reuse installed deps; build newest configuration' -complete -c spack -n '__fish_spack_using_command build-env-dive' -l reuse -f -a concretizer_reuse -complete -c spack -n '__fish_spack_using_command build-env-dive' -l reuse -d 'reuse installed packages/buildcaches when possible' -complete -c spack -n '__fish_spack_using_command build-env-dive' -l fresh-roots -l reuse-deps -f -a concretizer_reuse -complete -c spack -n '__fish_spack_using_command build-env-dive' -l fresh-roots -l reuse-deps -d 'concretize with fresh roots and reused dependencies' -complete -c spack -n '__fish_spack_using_command build-env-dive' -l deprecated -f -a config_deprecated -complete -c spack -n '__fish_spack_using_command build-env-dive' -l deprecated -d 'allow concretizer to select deprecated versions' -complete -c spack -n '__fish_spack_using_command build-env-dive' -l dump -r -f -a dump -complete -c spack -n '__fish_spack_using_command build-env-dive' -l dump -r -d 'dump a source-able environment to FILE' -complete -c spack -n '__fish_spack_using_command build-env-dive' -l pickle -r -f -a pickle -complete -c spack -n '__fish_spack_using_command build-env-dive' -l pickle -r -d 'dump a pickled source-able environment to FILE' -complete -c spack -n '__fish_spack_using_command build-env-dive' -s d -l dive -f -a dive -complete -c spack -n '__fish_spack_using_command build-env-dive' -s d -l dive -d 'dive into the build-env in a subshell' -complete -c spack -n '__fish_spack_using_command build-env-dive' -l status -f -a status -complete -c spack -n '__fish_spack_using_command build-env-dive' -l status -d 'check shell for an active build environment' +# spack dev-dive +set -g __fish_spack_optspecs_spack_dev_dive h/help clean dirty U/fresh reuse fresh-roots deprecated dump= pickle= d/dive c/cd= status + +complete -c spack -n '__fish_spack_using_command dev-dive' -s h -l help -f -a help +complete -c spack -n '__fish_spack_using_command dev-dive' -s h -l help -d 'show this help message and exit' +complete -c spack -n '__fish_spack_using_command dev-dive' -l clean -f -a dirty +complete -c spack -n '__fish_spack_using_command dev-dive' -l clean -d 'unset harmful variables in the build environment (default)' +complete -c spack -n '__fish_spack_using_command dev-dive' -l dirty -f -a dirty +complete -c spack -n '__fish_spack_using_command dev-dive' -l dirty -d 'preserve user environment in spack'"'"'s build environment (danger!)' +complete -c spack -n '__fish_spack_using_command dev-dive' -s U -l fresh -f -a concretizer_reuse +complete -c spack -n '__fish_spack_using_command dev-dive' -s U -l fresh -d 'do not reuse installed deps; build newest configuration' +complete -c spack -n '__fish_spack_using_command dev-dive' -l reuse -f -a concretizer_reuse +complete -c spack -n '__fish_spack_using_command dev-dive' -l reuse -d 'reuse installed packages/buildcaches when possible' +complete -c spack -n '__fish_spack_using_command dev-dive' -l fresh-roots -l reuse-deps -f -a concretizer_reuse +complete -c spack -n '__fish_spack_using_command dev-dive' -l fresh-roots -l reuse-deps -d 'concretize with fresh roots and reused dependencies' +complete -c spack -n '__fish_spack_using_command dev-dive' -l deprecated -f -a config_deprecated +complete -c spack -n '__fish_spack_using_command dev-dive' -l deprecated -d 'allow concretizer to select deprecated versions' +complete -c spack -n '__fish_spack_using_command dev-dive' -l dump -r -f -a dump +complete -c spack -n '__fish_spack_using_command dev-dive' -l dump -r -d 'dump a source-able environment to FILE' +complete -c spack -n '__fish_spack_using_command dev-dive' -l pickle -r -f -a pickle +complete -c spack -n '__fish_spack_using_command dev-dive' -l pickle -r -d 'dump a pickled source-able environment to FILE' +complete -c spack -n '__fish_spack_using_command dev-dive' -s d -l dive -f -a dive +complete -c spack -n '__fish_spack_using_command dev-dive' -s d -l dive -d 'dive into the build-env in a subshell' +complete -c spack -n '__fish_spack_using_command dev-dive' -s c -l cd -r -f -a cd +complete -c spack -n '__fish_spack_using_command dev-dive' -s c -l cd -r -d 'location to dive to or run command from (takes arguments from '"'"'spack cd'"'"')' +complete -c spack -n '__fish_spack_using_command dev-dive' -l status -f -a status +complete -c spack -n '__fish_spack_using_command dev-dive' -l status -d 'check shell for an active build environment' # spack buildcache set -g __fish_spack_optspecs_spack_buildcache h/help @@ -851,7 +855,7 @@ complete -c spack -n '__fish_spack_using_command buildcache check' -s m -l mirro complete -c spack -n '__fish_spack_using_command buildcache check' -s m -l mirror-url -r -d 'override any configured mirrors with this mirror URL' complete -c spack -n '__fish_spack_using_command buildcache check' -s o -l output-file -r -f -a output_file complete -c spack -n '__fish_spack_using_command buildcache check' -s o -l output-file -r -d 'file where rebuild info should be written' -complete -c spack -n '__fish_spack_using_command buildcache check' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command buildcache check' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command buildcache check' -l scope -r -d 'configuration scope containing mirrors to check' complete -c spack -n '__fish_spack_using_command buildcache check' -s s -l spec -r -f -a spec complete -c spack -n '__fish_spack_using_command buildcache check' -s s -l spec -r -d 'check single spec instead of release specs file' @@ -1098,7 +1102,7 @@ complete -c spack -n '__fish_spack_using_command compiler find' -l mixed-toolcha complete -c spack -n '__fish_spack_using_command compiler find' -l mixed-toolchain -d 'Allow mixed toolchains (for example: clang, clang++, gfortran)' complete -c spack -n '__fish_spack_using_command compiler find' -l no-mixed-toolchain -f -a mixed_toolchain complete -c spack -n '__fish_spack_using_command compiler find' -l no-mixed-toolchain -d 'Do not allow mixed toolchains (for example: clang, clang++, gfortran)' -complete -c spack -n '__fish_spack_using_command compiler find' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command compiler find' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command compiler find' -l scope -r -d 'configuration scope to modify' complete -c spack -n '__fish_spack_using_command compiler find' -s j -l jobs -r -f -a jobs complete -c spack -n '__fish_spack_using_command compiler find' -s j -l jobs -r -d 'explicitly set number of parallel jobs' @@ -1112,7 +1116,7 @@ complete -c spack -n '__fish_spack_using_command compiler add' -l mixed-toolchai complete -c spack -n '__fish_spack_using_command compiler add' -l mixed-toolchain -d 'Allow mixed toolchains (for example: clang, clang++, gfortran)' complete -c spack -n '__fish_spack_using_command compiler add' -l no-mixed-toolchain -f -a mixed_toolchain complete -c spack -n '__fish_spack_using_command compiler add' -l no-mixed-toolchain -d 'Do not allow mixed toolchains (for example: clang, clang++, gfortran)' -complete -c spack -n '__fish_spack_using_command compiler add' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command compiler add' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command compiler add' -l scope -r -d 'configuration scope to modify' complete -c spack -n '__fish_spack_using_command compiler add' -s j -l jobs -r -f -a jobs complete -c spack -n '__fish_spack_using_command compiler add' -s j -l jobs -r -d 'explicitly set number of parallel jobs' @@ -1124,7 +1128,7 @@ complete -c spack -n '__fish_spack_using_command compiler remove' -s h -l help - complete -c spack -n '__fish_spack_using_command compiler remove' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command compiler remove' -s a -l all -f -a all complete -c spack -n '__fish_spack_using_command compiler remove' -s a -l all -d 'remove ALL compilers that match spec' -complete -c spack -n '__fish_spack_using_command compiler remove' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command compiler remove' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command compiler remove' -l scope -r -d 'configuration scope to modify' # spack compiler rm @@ -1134,14 +1138,14 @@ complete -c spack -n '__fish_spack_using_command compiler rm' -s h -l help -f -a complete -c spack -n '__fish_spack_using_command compiler rm' -s h -l help -d 'show this help message and exit' complete -c spack -n '__fish_spack_using_command compiler rm' -s a -l all -f -a all complete -c spack -n '__fish_spack_using_command compiler rm' -s a -l all -d 'remove ALL compilers that match spec' -complete -c spack -n '__fish_spack_using_command compiler rm' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command compiler rm' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command compiler rm' -l scope -r -d 'configuration scope to modify' # spack compiler list set -g __fish_spack_optspecs_spack_compiler_list h/help scope= complete -c spack -n '__fish_spack_using_command compiler list' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command compiler list' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command compiler list' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command compiler list' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command compiler list' -l scope -r -d 'configuration scope to read from' # spack compiler info @@ -1149,14 +1153,14 @@ set -g __fish_spack_optspecs_spack_compiler_info h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 compiler info' -f -a '(__fish_spack_installed_compilers)' complete -c spack -n '__fish_spack_using_command compiler info' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command compiler info' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command compiler info' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command compiler info' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command compiler info' -l scope -r -d 'configuration scope to read from' # spack compilers set -g __fish_spack_optspecs_spack_compilers h/help scope= complete -c spack -n '__fish_spack_using_command compilers' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command compilers' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command compilers' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command compilers' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command compilers' -l scope -r -d 'configuration scope to read/modify' # spack concretize @@ -1216,7 +1220,7 @@ complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a update -d ' complete -c spack -n '__fish_spack_using_command_pos 0 config' -f -a revert -d 'revert configuration files to their state before update' complete -c spack -n '__fish_spack_using_command config' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command config' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command config' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command config' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command config' -l scope -r -d 'configuration scope to read/modify' # spack config get @@ -1759,7 +1763,7 @@ complete -c spack -n '__fish_spack_using_command external find' -l exclude -r -f complete -c spack -n '__fish_spack_using_command external find' -l exclude -r -d 'packages to exclude from search' complete -c spack -n '__fish_spack_using_command external find' -s p -l path -r -f -a path complete -c spack -n '__fish_spack_using_command external find' -s p -l path -r -d 'one or more alternative search paths for finding externals' -complete -c spack -n '__fish_spack_using_command external find' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command external find' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command external find' -l scope -r -d 'configuration scope to modify' complete -c spack -n '__fish_spack_using_command external find' -l all -f -a all complete -c spack -n '__fish_spack_using_command external find' -l all -d 'search for all packages that Spack knows about' @@ -2332,7 +2336,7 @@ set -g __fish_spack_optspecs_spack_mirror_add h/help scope= type= autopush unsig complete -c spack -n '__fish_spack_using_command_pos 0 mirror add' -f complete -c spack -n '__fish_spack_using_command mirror add' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command mirror add' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command mirror add' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command mirror add' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command mirror add' -l scope -r -d 'configuration scope to modify' complete -c spack -n '__fish_spack_using_command mirror add' -l type -r -f -a 'binary source' complete -c spack -n '__fish_spack_using_command mirror add' -l type -r -d 'specify the mirror type: for both binary and source use `--type binary --type source` (default)' @@ -2372,7 +2376,7 @@ set -g __fish_spack_optspecs_spack_mirror_remove h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 mirror remove' -f -a '(__fish_spack_mirrors)' complete -c spack -n '__fish_spack_using_command mirror remove' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command mirror remove' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command mirror remove' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command mirror remove' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command mirror remove' -l scope -r -d 'configuration scope to modify' # spack mirror rm @@ -2380,7 +2384,7 @@ set -g __fish_spack_optspecs_spack_mirror_rm h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 mirror rm' -f -a '(__fish_spack_mirrors)' complete -c spack -n '__fish_spack_using_command mirror rm' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command mirror rm' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command mirror rm' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command mirror rm' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command mirror rm' -l scope -r -d 'configuration scope to modify' # spack mirror set-url @@ -2392,7 +2396,7 @@ complete -c spack -n '__fish_spack_using_command mirror set-url' -l push -f -a p complete -c spack -n '__fish_spack_using_command mirror set-url' -l push -d 'set only the URL used for uploading' complete -c spack -n '__fish_spack_using_command mirror set-url' -l fetch -f -a fetch complete -c spack -n '__fish_spack_using_command mirror set-url' -l fetch -d 'set only the URL used for downloading' -complete -c spack -n '__fish_spack_using_command mirror set-url' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command mirror set-url' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command mirror set-url' -l scope -r -d 'configuration scope to modify' complete -c spack -n '__fish_spack_using_command mirror set-url' -l s3-access-key-id -r -f -a s3_access_key_id complete -c spack -n '__fish_spack_using_command mirror set-url' -l s3-access-key-id -r -d 'ID string to use to connect to this S3 mirror' @@ -2440,7 +2444,7 @@ complete -c spack -n '__fish_spack_using_command mirror set' -l unsigned -f -a s complete -c spack -n '__fish_spack_using_command mirror set' -l unsigned -d 'do not require signing and signature verification when pushing and installing from this build cache' complete -c spack -n '__fish_spack_using_command mirror set' -l signed -f -a signed complete -c spack -n '__fish_spack_using_command mirror set' -l signed -d 'require signing and signature verification when pushing and installing from this build cache' -complete -c spack -n '__fish_spack_using_command mirror set' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command mirror set' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command mirror set' -l scope -r -d 'configuration scope to modify' complete -c spack -n '__fish_spack_using_command mirror set' -l s3-access-key-id -r -f -a s3_access_key_id complete -c spack -n '__fish_spack_using_command mirror set' -l s3-access-key-id -r -d 'ID string to use to connect to this S3 mirror' @@ -2471,7 +2475,7 @@ complete -c spack -n '__fish_spack_using_command mirror set' -l oci-password-var set -g __fish_spack_optspecs_spack_mirror_list h/help scope= complete -c spack -n '__fish_spack_using_command mirror list' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command mirror list' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command mirror list' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command mirror list' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command mirror list' -l scope -r -d 'configuration scope to read from' # spack module @@ -2778,7 +2782,7 @@ complete -c spack -n '__fish_spack_using_command repo create' -s d -l subdirecto set -g __fish_spack_optspecs_spack_repo_list h/help scope= complete -c spack -n '__fish_spack_using_command repo list' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command repo list' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command repo list' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command repo list' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command repo list' -l scope -r -d 'configuration scope to read from' # spack repo add @@ -2786,7 +2790,7 @@ set -g __fish_spack_optspecs_spack_repo_add h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 repo add' -f -a '(__fish_complete_directories)' complete -c spack -n '__fish_spack_using_command repo add' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command repo add' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command repo add' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command repo add' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command repo add' -l scope -r -d 'configuration scope to modify' # spack repo remove @@ -2794,7 +2798,7 @@ set -g __fish_spack_optspecs_spack_repo_remove h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 repo remove' $__fish_spack_force_files -a '(__fish_spack_repos)' complete -c spack -n '__fish_spack_using_command repo remove' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command repo remove' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command repo remove' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command repo remove' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command repo remove' -l scope -r -d 'configuration scope to modify' # spack repo rm @@ -2802,7 +2806,7 @@ set -g __fish_spack_optspecs_spack_repo_rm h/help scope= complete -c spack -n '__fish_spack_using_command_pos 0 repo rm' $__fish_spack_force_files -a '(__fish_spack_repos)' complete -c spack -n '__fish_spack_using_command repo rm' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command repo rm' -s h -l help -d 'show this help message and exit' -complete -c spack -n '__fish_spack_using_command repo rm' -l scope -r -f -a '_builtin defaults site env:/var/folders/ln/1_3kxbwd35s_ylsjlm3zmqmc00307v/T/spack-7ac2um2h command_line' +complete -c spack -n '__fish_spack_using_command repo rm' -l scope -r -f -a '_builtin defaults system site user command_line' complete -c spack -n '__fish_spack_using_command repo rm' -l scope -r -d 'configuration scope to modify' # spack resource @@ -3038,7 +3042,7 @@ complete -c spack -n '__fish_spack_using_command test remove' -s y -l yes-to-all complete -c spack -n '__fish_spack_using_command test remove' -s y -l yes-to-all -d 'assume "yes" is the answer to every confirmation request' # spack test-env -set -g __fish_spack_optspecs_spack_test_env h/help clean dirty U/fresh reuse fresh-roots deprecated dump= pickle= d/dive status +set -g __fish_spack_optspecs_spack_test_env h/help clean dirty U/fresh reuse fresh-roots deprecated dump= pickle= d/dive c/cd= status complete -c spack -n '__fish_spack_using_command_pos_remainder 0 test-env' -f -a '(__fish_spack_build_env_spec)' complete -c spack -n '__fish_spack_using_command test-env' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command test-env' -s h -l help -d 'show this help message and exit' @@ -3060,6 +3064,8 @@ complete -c spack -n '__fish_spack_using_command test-env' -l pickle -r -f -a pi complete -c spack -n '__fish_spack_using_command test-env' -l pickle -r -d 'dump a pickled source-able environment to FILE' complete -c spack -n '__fish_spack_using_command test-env' -s d -l dive -f -a dive complete -c spack -n '__fish_spack_using_command test-env' -s d -l dive -d 'dive into the build-env in a subshell' +complete -c spack -n '__fish_spack_using_command test-env' -s c -l cd -r -f -a cd +complete -c spack -n '__fish_spack_using_command test-env' -s c -l cd -r -d 'location to dive to or run command from (takes arguments from '"'"'spack cd'"'"')' complete -c spack -n '__fish_spack_using_command test-env' -l status -f -a status complete -c spack -n '__fish_spack_using_command test-env' -l status -d 'check shell for an active build environment'