-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazel Windows Cross Compile Broken #7
Comments
This is at least a regression in Bazel. And at worst the platforms constraints never worked correctly - I have submitted a bug to Bazel: bazelbuild/bazel#22164 In the meantime, I have implemented bzlmod support in the EWDK toolchain repo. That will allow us to re-integrate with EWDK toolchain resolution as a workaround: 0xf005ba11/bazel_ewdk_cc#1 I will be putting together a PR on this repo to provide a workaround. Hopefully Bazel can address the problem or advise on another solution. |
I've tracked down another problem in bazelisk that explains the problem with trying to compile natively on ARM64: |
I've implemented the workaround for cross compiling here: #9 Keeping this open for tracking the issues brought to Bazel and for visibility. |
This has been resolved by the upstream changes to bazel tooling - bazelisk now provides a native ARM64 windows build. The workaround still exists in the EWDK toolchain. |
Brief description of your issue
Compiling non-x64 for Windows through Bazel is broken. This is necessary to do testing for other architectures on Windows. This probably changed when we removed the ability to compile with the EWDK. The EWDK toolchain previously supported cross compilation. The cross compilation platform defintions here are broken somehow with the "normal" Bazel tool-chain resolution:
radiant-cpp/BUILD.bazel
Lines 45 to 79 in e32b683
Steps to reproduce (optional)
On an x64 or ARM64 Windows host:
Interestingly an ARM64 host resolves the default host tool-chain to x64 and outputs x64 binaries instead of ARM64. This seems like a bug in the MSVC Bazel tool-chain?
On my x64 host:
Seems like a bug in Bazel tool-chain resolution for a standard MSVC (Visual Studio) install. A workaround might be manually activating the build environment before triggering Bazel tool-chain resolution:
Expected behavior (optional)
Specifying a platform to build should cross-compile for that architecture for Windows. Not specifying an architecture should build using the native host tool-chain.
Actual behavior (optional)
Compilation fails if you try to cross compile. On an ARM64 host the located tool-chain is x64 and chooses the x64 target, so you end up with a x64 binary instead of the intended native ARM64 one.
Environment (optional)
The text was updated successfully, but these errors were encountered: