Validate that rules without toolchain context cannot create actions #20505
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Configurability
platforms, toolchains, cquery, select(), config transitions
team-Rules-API
API for writing rules/aspects: providers, runfiles, actions, artifacts
type: feature request
In theory,
RuleContext.getToolchainContext
will only returnnull
if the rule is not generating actions (as set inRuleClass.Builder.useToolchainResolution(ToolchainResolutionMode.DISABLED)
). However, we aren't currently validating this, and it's possible that legacy rules are violating this.We should add explicit validation around this to ensure that any rule which generates actions has a toolchain context (which includes both the target and exec platforms for that configured target).
The text was updated successfully, but these errors were encountered: