-
Notifications
You must be signed in to change notification settings - Fork 108
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
cc_tool builds src for wrong platform #299
Comments
I don't think I quite understand the reasoning in the explanation. Why should a cc_tool() not run on the exec platform? @matts1 fyi |
There were some aspects of the initial design that warranted putting |
I think it should be safe to just replace exec with target. |
My assumption was that your situation would end up with bazel configuring a seperate set of toolchains for each of your remote execution platforms, so you'd get:
I'm hoping someone knowledgable about platforms can educate me more, but is it possible that since the toolchain itself says it's compatible with all execution platforms, it sees macos exec, creates a toolchain for that, then sees linux exec and sees that the toolchain supports linux and attempts to map linux to the existing toolchain instead of creating another one? I wouldn't be surprised if the original authors of the toolchain logic never considered that someone might make one toolchain for all platforms using |
it looks like you're right, so at least 1 way to make it work is to create 3 separate targets for |
rules_cc/cc/toolchains/tool.bzl
Line 68 in 8c94e11
I think
cc_tool(src)
should becfg=target
, notcfg=exec
.Explanation: The
cc_tool
rule does not (itself) execute the tool as a build action (no ctx.actions.run). Presumably there will eventually be some other rule that uses the output from cc_tool as an attribute, and (importantly) also invokes the tool. That rule should consume the tool via an attribute with cfg=exec, so the tool transition can evaluate all the constraints correctly for that rule.The text was updated successfully, but these errors were encountered: