diff options
author | John W. Parent <45471568+johnwparent@users.noreply.github.com> | 2024-05-30 19:10:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 17:10:29 -0600 |
commit | a7381a94133519427c5745711bcb83adcd9810af (patch) | |
tree | 92f239512bc07aa0db4799521e7dca95bb568e4f /lib | |
parent | b932783d4d922cc4fbd5924e468184f90a618163 (diff) | |
download | spack-a7381a94133519427c5745711bcb83adcd9810af.tar.gz spack-a7381a94133519427c5745711bcb83adcd9810af.tar.bz2 spack-a7381a94133519427c5745711bcb83adcd9810af.tar.xz spack-a7381a94133519427c5745711bcb83adcd9810af.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/bootstrap/_common.py | 7 |
1 files 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}" |