bazel-contrib / rules-template

A template for creating a new Bazel ruleset
Apache License 2.0
78 stars 20 forks source link

Declare toolchain only constrained by the exec platform #9

Closed alexeagle closed 2 years ago

alexeagle commented 2 years ago

Typically we expect rules fetch toolchains for use during actions, so the toolchain selection should be based on the execution platform. It's possible that tools may need to run on the target platform, but rulesets could still declare a second toolchain constrained by the target.

The code here is incorrect, as when the exec platform differs from the target platform, toolchain selection will find no matching toolchain