diff --git a/lib/spack/spack/bootstrap/config.py b/lib/spack/spack/bootstrap/config.py index 3feaef1d374..51edeccc25d 100644 --- a/lib/spack/spack/bootstrap/config.py +++ b/lib/spack/spack/bootstrap/config.py @@ -152,7 +152,7 @@ def _ensure_bootstrap_configuration() -> Generator: bootstrap_store_path = store_path() user_configuration = _read_and_sanitize_configuration() with spack.environment.no_active_environment(): - with spack.platforms.prevent_cray_detection(), spack.platforms.use_platform( + with spack.platforms.use_platform( spack.platforms.real_host() ), spack.repo.use_repositories(spack.paths.packages_path): # Default configuration scopes excluding command line diff --git a/lib/spack/spack/platforms/__init__.py b/lib/spack/spack/platforms/__init__.py index 87566bf87f3..e49f87b2a70 100644 --- a/lib/spack/spack/platforms/__init__.py +++ b/lib/spack/spack/platforms/__init__.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import contextlib -from ._functions import _host, by_name, platforms, prevent_cray_detection, reset +from ._functions import _host, by_name, platforms, reset from ._platform import Platform from .darwin import Darwin from .freebsd import FreeBSD @@ -23,7 +23,6 @@ "host", "by_name", "reset", - "prevent_cray_detection", ] #: The "real" platform of the host running Spack. This should not be changed diff --git a/lib/spack/spack/platforms/_functions.py b/lib/spack/spack/platforms/_functions.py index 92c8ee800e0..80ff277d21d 100644 --- a/lib/spack/spack/platforms/_functions.py +++ b/lib/spack/spack/platforms/_functions.py @@ -2,12 +2,8 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import contextlib - import llnl.util.lang -import spack.util.environment - from .darwin import Darwin from .freebsd import FreeBSD from .linux import Linux @@ -57,14 +53,3 @@ def by_name(name): """ platform_cls = cls_by_name(name) return platform_cls() if platform_cls else None - - -@contextlib.contextmanager -def prevent_cray_detection(): - """Context manager that prevents the detection of the Cray platform""" - reset() - try: - with spack.util.environment.set_env(MODULEPATH=""): - yield - finally: - reset()