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.
This commit is contained in:
parent
b932783d4d
commit
a7381a9413
@ -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}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user