bazelbuild / bazelbuild/rules_cc
cc_tool builds src for wrong platform
Open
category: toolchains
untriaged
- Dominant language
- Starlark
- Stars
- 247
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/bazelbuild/rules_cc/blob/8c94e11c2b05b5f25ced5f23cd07d0cdd36edc1a/cc/toolchains/tool.bzl#L68
I think `cc_tool(src)` should be `cfg=target`, not `cfg=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.
Contributor guide
Assessment
This issue has not been assessed yet.