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.
This commit is contained in:
parent
2bacab0402
commit
c882214273
@ -480,11 +480,18 @@ def _add_externals_if_missing() -> None:
|
|||||||
spack.repo.PATH.get_pkg_class("bison"),
|
spack.repo.PATH.get_pkg_class("bison"),
|
||||||
# GnuPG
|
# GnuPG
|
||||||
spack.repo.PATH.get_pkg_class("gawk"),
|
spack.repo.PATH.get_pkg_class("gawk"),
|
||||||
|
# develop deps
|
||||||
|
spack.repo.PATH.get_pkg_class("git"),
|
||||||
]
|
]
|
||||||
if IS_WINDOWS:
|
if IS_WINDOWS:
|
||||||
search_list.append(spack.repo.PATH.get_pkg_class("winbison"))
|
search_list.append(spack.repo.PATH.get_pkg_class("winbison"))
|
||||||
detected_packages = spack.detection.by_executable(search_list)
|
externals = spack.detection.by_executable(search_list)
|
||||||
spack.detection.update_configuration(detected_packages, scope="bootstrap")
|
# 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:
|
def clingo_root_spec() -> str:
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
from ._common import _root_spec
|
from ._common import _root_spec
|
||||||
from .config import root_path, spec_for_current_python, store_path
|
from .config import root_path, spec_for_current_python, store_path
|
||||||
|
from .core import _add_externals_if_missing
|
||||||
|
|
||||||
|
|
||||||
class BootstrapEnvironment(spack.environment.Environment):
|
class BootstrapEnvironment(spack.environment.Environment):
|
||||||
@ -185,6 +186,7 @@ def pytest_root_spec() -> str:
|
|||||||
|
|
||||||
def ensure_environment_dependencies() -> None:
|
def ensure_environment_dependencies() -> None:
|
||||||
"""Ensure Spack dependencies from the bootstrap environment are installed and ready to use"""
|
"""Ensure Spack dependencies from the bootstrap environment are installed and ready to use"""
|
||||||
|
_add_externals_if_missing()
|
||||||
with BootstrapEnvironment() as env:
|
with BootstrapEnvironment() as env:
|
||||||
env.update_installations()
|
env.update_installations()
|
||||||
env.update_syspath_and_environ()
|
env.update_syspath_and_environ()
|
||||||
|
Loading…
Reference in New Issue
Block a user