summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-05-06 14:02:39 +0200
committerGitHub <noreply@github.com>2024-05-06 14:02:39 +0200
commitdc71dcfdc214a7352ea4dad54238cf60c2201605 (patch)
tree97c2128638f410e8004d65b9f87893bbb18501e6 /lib
parent1f31c3374ccfb843cc36e6c967fc61c8b832f10f (diff)
downloadspack-dc71dcfdc214a7352ea4dad54238cf60c2201605.tar.gz
spack-dc71dcfdc214a7352ea4dad54238cf60c2201605.tar.bz2
spack-dc71dcfdc214a7352ea4dad54238cf60c2201605.tar.xz
spack-dc71dcfdc214a7352ea4dad54238cf60c2201605.zip
bootstrap: lazy bootstrapping of clingo and GnuPG (#44026)
Currently bootstrapping from source fails because clingo requires gnupg requires clingo. This commit stops eager bootstrapping. We don't need `patchelf` nor `gnupg` generally. They're bootstrapped when needed.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/bootstrap/__init__.py10
-rw-r--r--lib/spack/spack/environment/environment.py2
-rw-r--r--lib/spack/spack/solver/core.py2
-rw-r--r--lib/spack/spack/util/gpg.py2
4 files changed, 12 insertions, 4 deletions
diff --git a/lib/spack/spack/bootstrap/__init__.py b/lib/spack/spack/bootstrap/__init__.py
index d6844ac14d..85935cd0e0 100644
--- a/lib/spack/spack/bootstrap/__init__.py
+++ b/lib/spack/spack/bootstrap/__init__.py
@@ -5,7 +5,13 @@
"""Function and classes needed to bootstrap Spack itself."""
from .config import ensure_bootstrap_configuration, is_bootstrapping, store_path
-from .core import all_core_root_specs, ensure_core_dependencies, ensure_patchelf_in_path_or_raise
+from .core import (
+ all_core_root_specs,
+ ensure_clingo_importable_or_raise,
+ ensure_core_dependencies,
+ ensure_gpg_in_path_or_raise,
+ ensure_patchelf_in_path_or_raise,
+)
from .environment import BootstrapEnvironment, ensure_environment_dependencies
from .status import status_message
@@ -13,6 +19,8 @@ __all__ = [
"is_bootstrapping",
"ensure_bootstrap_configuration",
"ensure_core_dependencies",
+ "ensure_gpg_in_path_or_raise",
+ "ensure_clingo_importable_or_raise",
"ensure_patchelf_in_path_or_raise",
"all_core_root_specs",
"ensure_environment_dependencies",
diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py
index f394efd7de..f14919adb6 100644
--- a/lib/spack/spack/environment/environment.py
+++ b/lib/spack/spack/environment/environment.py
@@ -1415,7 +1415,7 @@ class Environment:
# Ensure we don't try to bootstrap clingo in parallel
if spack.config.get("config:concretizer", "clingo") == "clingo":
with spack.bootstrap.ensure_bootstrap_configuration():
- spack.bootstrap.ensure_core_dependencies()
+ spack.bootstrap.ensure_clingo_importable_or_raise()
# Ensure all the indexes have been built or updated, since
# otherwise the processes in the pool may timeout on waiting
diff --git a/lib/spack/spack/solver/core.py b/lib/spack/spack/solver/core.py
index 13a3af2cd1..896631290c 100644
--- a/lib/spack/spack/solver/core.py
+++ b/lib/spack/spack/solver/core.py
@@ -195,7 +195,7 @@ def _bootstrap_clingo() -> ModuleType:
import spack.bootstrap
with spack.bootstrap.ensure_bootstrap_configuration():
- spack.bootstrap.ensure_core_dependencies()
+ spack.bootstrap.ensure_clingo_importable_or_raise()
clingo_mod = importlib.import_module("clingo")
return clingo_mod
diff --git a/lib/spack/spack/util/gpg.py b/lib/spack/spack/util/gpg.py
index beae7f707b..b35876c4b2 100644
--- a/lib/spack/spack/util/gpg.py
+++ b/lib/spack/spack/util/gpg.py
@@ -60,7 +60,7 @@ def init(gnupghome=None, force=False):
# Set the executable objects for "gpg" and "gpgconf"
with spack.bootstrap.ensure_bootstrap_configuration():
- spack.bootstrap.ensure_core_dependencies()
+ spack.bootstrap.ensure_gpg_in_path_or_raise()
GPG, GPGCONF = _gpg(), _gpgconf()
GPG.add_default_env("GNUPGHOME", GNUPGHOME)