From 4d49a658c81b2fa06d96659ff8d62f9b0914e3ff Mon Sep 17 00:00:00 2001 From: psakiev Date: Tue, 12 Nov 2024 15:28:34 -0700 Subject: [PATCH] Add completion --- etc/spack/defaults/config.yaml | 1 + lib/spack/spack/cmd/build_env.py | 2 +- lib/spack/spack/cmd/common/env_utility.py | 39 ++++++-- lib/spack/spack/cmd/dev_build.py | 9 +- lib/spack/spack/util/shell_detection.py | 4 +- share/spack/spack-completion.bash | 19 ++-- share/spack/spack-completion.fish | 103 +++++++++++++++------- 7 files changed, 123 insertions(+), 54 deletions(-) diff --git a/etc/spack/defaults/config.yaml b/etc/spack/defaults/config.yaml index b9c4aee64ee..0064870fbe7 100644 --- a/etc/spack/defaults/config.yaml +++ b/etc/spack/defaults/config.yaml @@ -220,3 +220,4 @@ config: concretise: concretize containerise: containerize rm: remove + build-env-dive: build-env --dive diff --git a/lib/spack/spack/cmd/build_env.py b/lib/spack/spack/cmd/build_env.py index 89fcd367831..96623affa35 100644 --- a/lib/spack/spack/cmd/build_env.py +++ b/lib/spack/spack/cmd/build_env.py @@ -14,7 +14,7 @@ setup_parser = env_utility.setup_parser -#TODO create a dropin/dive funciton that dev_build and build_env cmd's can use +# 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 f2f27172537..b3d1a159f91 100644 --- a/lib/spack/spack/cmd/common/env_utility.py +++ b/lib/spack/spack/cmd/common/env_utility.py @@ -29,7 +29,10 @@ def setup_parser(subparser): "--pickle", metavar="FILE", help="dump a pickled source-able environment to FILE" ) subparser.add_argument( - "--dive", action="store_true", help="dive into the build-env in a subshell" + "-d", "--dive", action="store_true", help="dive into the build-env in a subshell" + ) + subparser.add_argument( + "--status", action="store_true", help="check shell for an active build environment" ) subparser.add_argument( "spec", @@ -80,7 +83,25 @@ def neighbors(self, item): return item.edge.spec.edges_to_dependencies(depflag=depflag) +def run_command_in_subshell( + spec, context, cmd, prompt=False, dirty=False, 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() + os.execvp(cmd[0], cmd) + + def emulate_env_utility(cmd_name, context: Context, args): + if args.status: + context_var = os.environ.get(f"SPACK_{str(context).upper()}_ENV", None) + if context_var: + tty.msg(f"In {str(context)} env {context_var}") + else: + tty.msg(f"{str(context)} environment not detected") + exit(0) + if not args.spec: tty.die("spack %s requires a spec." % cmd_name) @@ -97,6 +118,12 @@ def emulate_env_utility(cmd_name, context: Context, args): spec = args.spec[0] cmd = args.spec[1:] + if args.dive: + if cmd: + tty.die("--dive and additional commands can't be run together") + else: + cmd = [active_shell_type()] + if not spec: tty.die("spack %s requires a spec." % cmd_name) @@ -111,6 +138,7 @@ def emulate_env_utility(cmd_name, context: Context, args): visitor = AreDepsInstalledVisitor(context=context) # Mass install check needs read transaction. + # FIXME: this command is slow with spack.store.STORE.db.read_transaction(): traverse.traverse_breadth_first_with_visitor([spec], traverse.CoverNodesVisitor(visitor)) @@ -141,14 +169,7 @@ def emulate_env_utility(cmd_name, context: Context, args): pickle_environment(args.pickle) if cmd: - # Execute the command with the new environment - os.execvp(cmd[0], cmd) - - if args.dive: - shell = active_shell_type() - mods.extend(spack.prompt.prompt_modifications(f"{spec.name}-{str(context)}-env", shell)) - mods.apply_modifications() - os.execvp(shell, [shell]) + run_command_in_subshell(spec, context, cmd, prompt=args.dive, location=args.cd) elif not bool(args.pickle or args.dump): # If no command or dump/pickle option then act like the "env" command diff --git a/lib/spack/spack/cmd/dev_build.py b/lib/spack/spack/cmd/dev_build.py index 4eec718e902..b5e75309ffc 100644 --- a/lib/spack/spack/cmd/dev_build.py +++ b/lib/spack/spack/cmd/dev_build.py @@ -16,6 +16,7 @@ import spack.prompt import spack.repo from spack.cmd.common import arguments +from spack.cmd.common.env_utility import run_command_in_subshell from spack.installer import PackageInstaller description = "developer build: build from user managed code" @@ -169,8 +170,6 @@ def dev_build(self, args): # drop into the build environment of the package? if args.shell is not None: - mods = spack.build_environment.setup_package(spec.package, dirty=False) - if args.prompt: - mods.extend(spack.prompt.prompt_modifications(f"{spec.name}-build-env", args.shell)) - mods.apply_modifications() - os.execvp(args.shell, [args.shell]) + run_command_in_subshell( + spec, context.BUILD, [args.shell], prompt=args.prompt, shell=args.shell + ) diff --git a/lib/spack/spack/util/shell_detection.py b/lib/spack/spack/util/shell_detection.py index 96a2b968c97..7af72f87028 100644 --- a/lib/spack/spack/util/shell_detection.py +++ b/lib/spack/spack/util/shell_detection.py @@ -16,7 +16,9 @@ def active_shell_type(env=os.environ): return "ps1" else: try: - output = subprocess.run("powershell -Command \"echo $PSVersionTable\"", shell=True, check=True, text=True) + output = subprocess.run( + 'powershell -Command "echo $PSVersionTable"', shell=True, check=True, text=True + ) if "PSVersion" in output: return "ps1" else: diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index 706fb7e2d59..1346474c6eb 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" +SPACK_ALIASES="concretise:concretize;containerise:containerize;rm:remove;build-env-dive:build-env --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 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 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" fi } @@ -553,7 +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" + SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive --status" + else + _all_packages + fi +} + +_spack_build_env_dive() { + if $list_options + then + SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive --status" else _all_packages fi @@ -981,7 +990,7 @@ _spack_deprecate() { _spack_dev_build() { if $list_options then - SPACK_COMPREPLY="-h --help -j --jobs -n --no-checksum -d --source-path -i --ignore-dependencies --keep-prefix --skip-patch -q --quiet --drop-in --test -b --before -u --until --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated" + SPACK_COMPREPLY="-h --help -j --jobs -n --no-checksum -d --source-path -i --ignore-dependencies --keep-prefix --skip-patch -q --quiet -D --drop-in -p --prompt --test -b --before -u --until --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated" else _all_packages fi @@ -1957,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" + SPACK_COMPREPLY="-h --help --clean --dirty -U --fresh --reuse --fresh-roots --reuse-deps --deprecated --dump --pickle -d --dive --status" else _all_packages fi diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index 52153f01c0e..70920652deb 100644 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -353,7 +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 install environment, or dump its environment to screen or file' +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 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' @@ -375,7 +376,7 @@ complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a deconcretize -d ' 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' -complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a dev-build -d 'developer build: build from code in current working directory' +complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a dev-build -d 'developer build: build from user managed code' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a develop -d 'add a spec to an environment'"'"'s dev-build information' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a diff -d 'compare two specs' complete -c spack -n '__fish_spack_using_command_pos 0 ' -f -a docs -d 'open spack documentation in a web browser' @@ -603,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 system site user command_line' +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 -d 'configuration scope to read/modify' # spack bootstrap disable @@ -611,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 system site user command_line' +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 -d 'configuration scope to read/modify' # spack bootstrap reset @@ -626,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 system site user command_line' +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 -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 system site user command_line' +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 -d 'configuration scope to read/modify' # spack bootstrap add @@ -642,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 system site user command_line' +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 -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' @@ -664,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= +set -g __fish_spack_optspecs_spack_build_env 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' -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' @@ -684,6 +685,36 @@ complete -c spack -n '__fish_spack_using_command build-env' -l dump -r -f -a dum complete -c spack -n '__fish_spack_using_command build-env' -l dump -r -d 'dump a source-able environment to FILE' complete -c spack -n '__fish_spack_using_command build-env' -l pickle -r -f -a pickle 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' -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 buildcache set -g __fish_spack_optspecs_spack_buildcache h/help @@ -820,7 +851,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 system site user command_line' +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 -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' @@ -1067,7 +1098,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 system site user command_line' +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 -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' @@ -1081,7 +1112,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 system site user command_line' +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 -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' @@ -1093,7 +1124,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 system site user command_line' +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 -d 'configuration scope to modify' # spack compiler rm @@ -1103,14 +1134,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 system site user command_line' +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 -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 system site user command_line' +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 -d 'configuration scope to read from' # spack compiler info @@ -1118,14 +1149,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 system site user command_line' +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 -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 system site user command_line' +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 -d 'configuration scope to read/modify' # spack concretize @@ -1185,7 +1216,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 system site user command_line' +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 -d 'configuration scope to read/modify' # spack config get @@ -1376,7 +1407,7 @@ complete -c spack -n '__fish_spack_using_command deprecate' -s l -l link-type -r complete -c spack -n '__fish_spack_using_command deprecate' -s l -l link-type -r -d '(deprecated)' # spack dev-build -set -g __fish_spack_optspecs_spack_dev_build h/help j/jobs= n/no-checksum d/source-path= i/ignore-dependencies keep-prefix skip-patch q/quiet drop-in= test= b/before= u/until= clean dirty U/fresh reuse fresh-roots deprecated +set -g __fish_spack_optspecs_spack_dev_build h/help j/jobs= n/no-checksum d/source-path= i/ignore-dependencies keep-prefix skip-patch q/quiet D/drop-in= p/prompt test= b/before= u/until= clean dirty U/fresh reuse fresh-roots deprecated complete -c spack -n '__fish_spack_using_command_pos_remainder 0 dev-build' -f -k -a '(__fish_spack_specs)' complete -c spack -n '__fish_spack_using_command dev-build' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command dev-build' -s h -l help -d 'show this help message and exit' @@ -1385,7 +1416,7 @@ complete -c spack -n '__fish_spack_using_command dev-build' -s j -l jobs -r -d ' complete -c spack -n '__fish_spack_using_command dev-build' -s n -l no-checksum -f -a no_checksum complete -c spack -n '__fish_spack_using_command dev-build' -s n -l no-checksum -d 'do not use checksums to verify downloaded files (unsafe)' complete -c spack -n '__fish_spack_using_command dev-build' -s d -l source-path -r -f -a source_path -complete -c spack -n '__fish_spack_using_command dev-build' -s d -l source-path -r -d 'path to source directory (defaults to the current directory)' +complete -c spack -n '__fish_spack_using_command dev-build' -s d -l source-path -r -d 'path to source directory (defaults to the current directory). ignored when using an active environment since the path is determined by the develop section of the environment manifest.' complete -c spack -n '__fish_spack_using_command dev-build' -s i -l ignore-dependencies -f -a ignore_deps complete -c spack -n '__fish_spack_using_command dev-build' -s i -l ignore-dependencies -d 'do not try to install dependencies of requested packages' complete -c spack -n '__fish_spack_using_command dev-build' -l keep-prefix -f -a keep_prefix @@ -1394,8 +1425,10 @@ complete -c spack -n '__fish_spack_using_command dev-build' -l skip-patch -f -a complete -c spack -n '__fish_spack_using_command dev-build' -l skip-patch -d 'skip patching for the developer build' complete -c spack -n '__fish_spack_using_command dev-build' -s q -l quiet -f -a quiet complete -c spack -n '__fish_spack_using_command dev-build' -s q -l quiet -d 'do not display verbose build output while installing' -complete -c spack -n '__fish_spack_using_command dev-build' -l drop-in -r -f -a shell -complete -c spack -n '__fish_spack_using_command dev-build' -l drop-in -r -d 'drop into a build environment in a new shell, e.g., bash' +complete -c spack -n '__fish_spack_using_command dev-build' -s D -l drop-in -r -f -a shell +complete -c spack -n '__fish_spack_using_command dev-build' -s D -l drop-in -r -d 'drop into a build environment in a new shell, e.g., bash' +complete -c spack -n '__fish_spack_using_command dev-build' -s p -l prompt -f -a prompt +complete -c spack -n '__fish_spack_using_command dev-build' -s p -l prompt -d 'change the prompt when droping into the build-env' complete -c spack -n '__fish_spack_using_command dev-build' -l test -r -f -a 'root all' complete -c spack -n '__fish_spack_using_command dev-build' -l test -r -d 'run tests on only root packages or all packages' complete -c spack -n '__fish_spack_using_command dev-build' -s b -l before -r -f -a before @@ -1726,7 +1759,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 system site user command_line' +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 -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' @@ -2299,7 +2332,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 system site user command_line' +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 -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)' @@ -2339,7 +2372,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 system site user command_line' +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 -d 'configuration scope to modify' # spack mirror rm @@ -2347,7 +2380,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 system site user command_line' +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 -d 'configuration scope to modify' # spack mirror set-url @@ -2359,7 +2392,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 system site user command_line' +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 -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' @@ -2407,7 +2440,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 system site user command_line' +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 -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' @@ -2438,7 +2471,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 system site user command_line' +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 -d 'configuration scope to read from' # spack module @@ -2745,7 +2778,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 system site user command_line' +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 -d 'configuration scope to read from' # spack repo add @@ -2753,7 +2786,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 system site user command_line' +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 -d 'configuration scope to modify' # spack repo remove @@ -2761,7 +2794,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 system site user command_line' +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 -d 'configuration scope to modify' # spack repo rm @@ -2769,7 +2802,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 system site user command_line' +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 -d 'configuration scope to modify' # spack resource @@ -3005,7 +3038,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= +set -g __fish_spack_optspecs_spack_test_env 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 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' @@ -3025,6 +3058,10 @@ complete -c spack -n '__fish_spack_using_command test-env' -l dump -r -f -a dump complete -c spack -n '__fish_spack_using_command test-env' -l dump -r -d 'dump a source-able environment to FILE' complete -c spack -n '__fish_spack_using_command test-env' -l pickle -r -f -a pickle 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' -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' # spack tutorial set -g __fish_spack_optspecs_spack_tutorial h/help y/yes-to-all