summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2020-05-05 17:37:34 -0700
committerGitHub <noreply@github.com>2020-05-05 17:37:34 -0700
commitb030a81a5f1d4a02cf611fc771bbeaf0bfc7963e (patch)
tree4c5f8dfe2b9aa42587496af9b2b4d4f499893b79 /share
parent7e5874c25029c2649d5ded2621533b17bd7c5196 (diff)
downloadspack-b030a81a5f1d4a02cf611fc771bbeaf0bfc7963e.tar.gz
spack-b030a81a5f1d4a02cf611fc771bbeaf0bfc7963e.tar.bz2
spack-b030a81a5f1d4a02cf611fc771bbeaf0bfc7963e.tar.xz
spack-b030a81a5f1d4a02cf611fc771bbeaf0bfc7963e.zip
Automatically find externals (#15158)
Add a `spack external find` command that tries to populate `packages.yaml` with external packages from the user's `$PATH`. This focuses on finding build dependencies. Currently, support has only been added for `cmake`. For a package to be discoverable with `spack external find`, it must define: * an `executables` class attribute containing a list of regular expressions that match executable names. * a `determine_spec_details(prefix, specs_in_prefix)` method Spack will call `determine_spec_details()` once for each prefix where executables are found, passing in the path to the prefix and the path to all found executables. The package is responsible for invoking the executables and figuring out what type of installation(s) are in the prefix, and returning one or more specs (each with version, variants or whatever else the user decides to include in the spec). The found specs and prefixes will be added to the user's `packages.yaml` file. Providing the `--not-buildable` option will mark all generated entries in `packages.yaml` as `buildable: False`
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/spack-completion.bash20
1 files changed, 19 insertions, 1 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index fce5360ff5..12d4c599b8 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -313,7 +313,7 @@ _spack() {
then
SPACK_COMPREPLY="-h --help -H --all-help --color -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 -p --profile --sorted-profile --lines -v --verbose --stacktrace -V --version --print-shell-vars"
else
- SPACK_COMPREPLY="activate add arch blame bootstrap build build-env buildcache cd checksum ci clean clone commands compiler compilers concretize config configure containerize create deactivate debug dependencies dependents deprecate dev-build diy docs edit env extensions fetch find flake8 gc gpg graph help info install license list load location log-parse maintainers mirror module patch pkg providers pydoc python reindex remove rm repo resource restage setup spec stage test uninstall unload upload-s3 url verify versions view"
+ SPACK_COMPREPLY="activate add arch blame bootstrap build build-env buildcache cd checksum ci clean clone commands compiler compilers concretize config configure containerize create deactivate debug dependencies dependents deprecate dev-build diy docs edit env extensions external fetch find flake8 gc gpg graph help info install license list load location log-parse maintainers mirror module patch pkg providers pydoc python reindex remove rm repo resource restage setup spec stage test uninstall unload upload-s3 url verify versions view"
fi
}
@@ -817,6 +817,24 @@ _spack_extensions() {
fi
}
+_spack_external() {
+ if $list_options
+ then
+ SPACK_COMPREPLY="-h --help"
+ else
+ SPACK_COMPREPLY="find"
+ fi
+}
+
+_spack_external_find() {
+ if $list_options
+ then
+ SPACK_COMPREPLY="-h --help --not-buildable"
+ else
+ _all_packages
+ fi
+}
+
_spack_fetch() {
if $list_options
then