summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2022-10-19 19:25:20 +0200
committerGitHub <noreply@github.com>2022-10-19 19:25:20 +0200
commit7ad7fde09cc62a5edfc44dea5fbc5324d07d4c37 (patch)
treee91852d31e0847ee3e4c40ba805833f0fe07e7f8
parent25cbb34579bacc704c7f17f691cb36bf8f08b17b (diff)
downloadspack-7ad7fde09cc62a5edfc44dea5fbc5324d07d4c37.tar.gz
spack-7ad7fde09cc62a5edfc44dea5fbc5324d07d4c37.tar.bz2
spack-7ad7fde09cc62a5edfc44dea5fbc5324d07d4c37.tar.xz
spack-7ad7fde09cc62a5edfc44dea5fbc5324d07d4c37.zip
Add a command to bootstrap Spack right now (#33407)
-rw-r--r--lib/spack/spack/cmd/bootstrap.py12
-rwxr-xr-xshare/spack/spack-completion.bash6
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py
index 9a782b64ea..fc1ab8e92d 100644
--- a/lib/spack/spack/cmd/bootstrap.py
+++ b/lib/spack/spack/cmd/bootstrap.py
@@ -5,6 +5,7 @@
from __future__ import print_function
import os.path
+import platform
import shutil
import tempfile
@@ -73,6 +74,8 @@ def _add_scope_option(parser):
def setup_parser(subparser):
sp = subparser.add_subparsers(dest="subcommand")
+ sp.add_parser("now", help="Spack ready, right now!")
+
status = sp.add_parser("status", help="get the status of Spack")
status.add_argument(
"--optional",
@@ -404,6 +407,14 @@ def _mirror(args):
print(instructions)
+def _now(args):
+ with spack.bootstrap.ensure_bootstrap_configuration():
+ spack.bootstrap.ensure_clingo_importable_or_raise()
+ spack.bootstrap.ensure_gpg_in_path_or_raise()
+ if platform.system().lower() == "linux":
+ spack.bootstrap.ensure_patchelf_in_path_or_raise()
+
+
def bootstrap(parser, args):
callbacks = {
"status": _status,
@@ -417,5 +428,6 @@ def bootstrap(parser, args):
"add": _add,
"remove": _remove,
"mirror": _mirror,
+ "now": _now,
}
callbacks[args.subcommand](args)
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash
index 1543cffd92..8b12116fe9 100755
--- a/share/spack/spack-completion.bash
+++ b/share/spack/spack-completion.bash
@@ -412,10 +412,14 @@ _spack_bootstrap() {
then
SPACK_COMPREPLY="-h --help"
else
- SPACK_COMPREPLY="status enable disable reset root list trust untrust add remove mirror"
+ SPACK_COMPREPLY="now status enable disable reset root list trust untrust add remove mirror"
fi
}
+_spack_bootstrap_now() {
+ SPACK_COMPREPLY="-h --help"
+}
+
_spack_bootstrap_status() {
SPACK_COMPREPLY="-h --help --optional --dev"
}