- Assume option 1, where all toolchains are optional
- Assume there is a rule for which there a mandatory toolchain and two optional ones.
- If we look at execution platforms and find 1 platform that provides the mandatory toolchain, but another that provides both of the optional toolchains, how will we know to correctly pick the one that only has 1 toolchain match?
That said. I think we could incrementally get there with a hybrid approach.
- Quickly move to "all toolchains are optional". Rule authors should start today towards migrating rules to fail if the toolchain is missing. Getting ahead of the bazel implementation.
- For the cases where a rule only has one toolchain, the old API and change to rules is sufficient.
- We could add a flag "--incompatible_all_toolchains_are_optional" that turns on this behavior. Declare a fixed time before the day it becomes true and then removed.
- We continue to work through use cases of mixed mandatory/optional toolchains w.r.t. execution platform priority.
What I would like to see is that we can move forward on allowing optionality in the most common case (single toolchain) soon, without getting bogged down in API for mandatory-ness vs. execution platforms.
Question: I am presuming the proposal does not mandate that all rule declarations change. That is, under option 2, should
toolchain_types = ["//toolchain:type1", "//toolchain:type2"],
continue to work? I think it has too, with the assumption that each is optional (if --incompatible_all_toolchains_are_optional is set)