-
Notifications
You must be signed in to change notification settings - Fork 147
Register both windows compilers to enable cross compilation #432
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
base: main
Are you sure you want to change the base?
Conversation
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. Signed-off-by: Austin Schuh <[email protected]>
| exec_compatible_with = HOST_CONSTRAINTS, | ||
| target_compatible_with = [ | ||
| "@platforms//cpu:armv7", | ||
| "@platforms//os:android", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended to be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, that is intentional. If you look at the original BUILD.toolchains.tpl, it has that toolchain always there in addition to the configured one. This keeps that behavior. If there is someone who knows more about if that is intentional or not here, happy to make a change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof. This is probably some legacy jank but I'm OK with making a separate change to cull this from the toolchains. (i.e. keep it for now for consistency)
|
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. |
| exec_compatible_with = HOST_CONSTRAINTS, | ||
| target_compatible_with = [ | ||
| "@platforms//cpu:armv7", | ||
| "@platforms//os:android", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof. This is probably some legacy jank but I'm OK with making a separate change to cull this from the toolchains. (i.e. keep it for now for consistency)
What I see in |
Comments from bazelbuild/rules_cc#432 suggested lower casing, let's make sure that works. Signed-off-by: Austin Schuh <[email protected]>
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. |
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.