Register both windows compilers to enable cross compilation
There is a perfectly good cross compiler for the other Windows variant (arm64 vs x86). The only problem is that it doesn't get registered by default, so it isn't easily available. Register both of them and let toolchain selection pick the right one automatically.
My understanding of the purpose of BUILD.toolchains.tpl is to register exactly one toolchain for targeting "your host."
This would seem to be a divergence where, on Windows, we register cross-compiling toolchain(s).
How do other folks handle this? I assume most folks doing cross-compilation manually register a different set of toolchain(s)?
Do we think that Windows developers are more likely to want the auto-detected, but cross-compile capable toolchains available?
If cross-compilation is simple to achieve and doesn't require additional tools (e.g. a large sysroot), it's generally pretty nice if the toolchain is registered automatically and users just have to set a different target platform.
How do other folks handle this? I assume most folks doing cross-compilation manually register a different set of toolchain(s)?
Do we think that Windows developers are more likely to want the auto-detected, but cross-compile capable toolchains available?
What I see in rules_python, etc, is that the philosophy more generally is "register everything that is reasonable, and let toolchain selection pick the right one". From the user's point of view, more things just work, but bazel does a reasonable amount of extra work.
How do other folks handle this? I assume most folks doing cross-compilation manually register a different set of toolchain(s)? Do we think that Windows developers are more likely to want the auto-detected, but cross-compile capable toolchains available?
What I see in
rules_python, etc, is that the philosophy more generally is "register everything that is reasonable, and let toolchain selection pick the right one". From the user's point of view, more things just work, but bazel does a reasonable amount of extra work.
I think this is reasonable -- and clearly this PR moves towards that goal. We could probably do much more but I am OK approving this.