From a7381a94133519427c5745711bcb83adcd9810af Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Thu, 30 May 2024 19:10:29 -0400 Subject: Bootstrapping: don't use Mac OS binaries on Windows (#44193) `BuildcacheBootstrapper` uses `Spec.intersects` to match specs needed for bootstrapping against the binary cache. The specs were not sufficiently-detailed to prevent matching e.g. cached binaries for Mac OS on Windows; this commit adds the platform to each requested bootstrap spec to prevent that. --- lib/spack/spack/bootstrap/_common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/bootstrap/_common.py b/lib/spack/spack/bootstrap/_common.py index 5c3ca93e94..2afc6ea17c 100644 --- a/lib/spack/spack/bootstrap/_common.py +++ b/lib/spack/spack/bootstrap/_common.py @@ -213,15 +213,18 @@ def _root_spec(spec_str: str) -> str: Args: spec_str: spec to be bootstrapped. Must be without compiler and target. """ - # Add a compiler requirement to the root spec. + # Add a compiler and platform requirement to the root spec. platform = str(spack.platforms.host()) + if platform == "darwin": spec_str += " %apple-clang" + elif platform == "windows": + spec_str += " %msvc" elif platform == "linux": spec_str += " %gcc" elif platform == "freebsd": spec_str += " %clang" - + spec_str += f" platform={platform}" target = archspec.cpu.host().family spec_str += f" target={target}" -- cgit v1.2.3-70-g09d2