summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2023-08-14 12:29:15 +0200
committerGitHub <noreply@github.com>2023-08-14 10:29:15 +0000
commitc882214273793c52f2865e068aa0499c610a2f37 (patch)
tree18c39952d09e8624de62119b7ca3921bbf62301c /lib
parent2bacab04027d4fc83630ebf1762a619c77407031 (diff)
downloadspack-c882214273793c52f2865e068aa0499c610a2f37.tar.gz
spack-c882214273793c52f2865e068aa0499c610a2f37.tar.bz2
spack-c882214273793c52f2865e068aa0499c610a2f37.tar.xz
spack-c882214273793c52f2865e068aa0499c610a2f37.zip
spack bootstrap dev: detect git as an external (#39417)
#36770 added git as a dependency to `setuptools-scm`. This in turn makes `git` a transitive dependency for our bootstrapping process. Since `git` may take a long time to build, and is found on most systems, try to detect it as an external.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/bootstrap/core.py11
-rw-r--r--lib/spack/spack/bootstrap/environment.py2
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/spack/spack/bootstrap/core.py b/lib/spack/spack/bootstrap/core.py
index 8f19bc590e..2dc56504a0 100644
--- a/lib/spack/spack/bootstrap/core.py
+++ b/lib/spack/spack/bootstrap/core.py
@@ -480,11 +480,18 @@ def _add_externals_if_missing() -> None:
spack.repo.PATH.get_pkg_class("bison"),
# GnuPG
spack.repo.PATH.get_pkg_class("gawk"),
+ # develop deps
+ spack.repo.PATH.get_pkg_class("git"),
]
if IS_WINDOWS:
search_list.append(spack.repo.PATH.get_pkg_class("winbison"))
- detected_packages = spack.detection.by_executable(search_list)
- spack.detection.update_configuration(detected_packages, scope="bootstrap")
+ externals = spack.detection.by_executable(search_list)
+ # System git is typically deprecated, so mark as non-buildable to force it as external
+ non_buildable_externals = {k: externals.pop(k) for k in ("git",) if k in externals}
+ spack.detection.update_configuration(externals, scope="bootstrap", buildable=True)
+ spack.detection.update_configuration(
+ non_buildable_externals, scope="bootstrap", buildable=False
+ )
def clingo_root_spec() -> str:
diff --git a/lib/spack/spack/bootstrap/environment.py b/lib/spack/spack/bootstrap/environment.py
index 158b7ecae3..a2086160f6 100644
--- a/lib/spack/spack/bootstrap/environment.py
+++ b/lib/spack/spack/bootstrap/environment.py
@@ -23,6 +23,7 @@ from spack.environment import depfile
from ._common import _root_spec
from .config import root_path, spec_for_current_python, store_path
+from .core import _add_externals_if_missing
class BootstrapEnvironment(spack.environment.Environment):
@@ -185,6 +186,7 @@ def pytest_root_spec() -> str:
def ensure_environment_dependencies() -> None:
"""Ensure Spack dependencies from the bootstrap environment are installed and ready to use"""
+ _add_externals_if_missing()
with BootstrapEnvironment() as env:
env.update_installations()
env.update_syspath_and_environ()