33load ("//foreign_cc:providers.bzl" , "ForeignCcDepsInfo" )
44
55def _extra_toolchains_transition_impl (settings , attrs ):
6- return {"//command_line_option:extra_toolchains" : attrs .extra_toolchains + settings ["//command_line_option:extra_toolchains" ]}
6+ return {"//command_line_option:extra_toolchains" : [ attrs .extra_toolchain ] + settings ["//command_line_option:extra_toolchains" ]}
77
88_extra_toolchains_transition = transition (
99 implementation = _extra_toolchains_transition_impl ,
@@ -21,12 +21,13 @@ def _extra_toolchains_transitioned_foreign_cc_target_impl(ctx):
2121 ]
2222
2323extra_toolchains_transitioned_foreign_cc_target = rule (
24- doc = "A rule for adding extra toolchains to consider when building the given target" ,
24+ doc = "A rule for adding an extra toolchain to consider when building the given target" ,
2525 implementation = _extra_toolchains_transitioned_foreign_cc_target_impl ,
2626 cfg = _extra_toolchains_transition ,
2727 attrs = {
28- "extra_toolchains" : attr .string_list (
29- doc = "Additional toolchains to consider" ,
28+ # This attr is singular to make it selectable when used for add make toolchain variant.
29+ "extra_toolchain" : attr .string (
30+ doc = "Additional toolchain to consider. Note, this is singular." ,
3031 mandatory = True ,
3132 ),
3233 "target" : attr .label (
@@ -64,7 +65,7 @@ def foreign_cc_rule_variant(name, rule, toolchain, **kwargs):
6465
6566 extra_toolchains_transitioned_foreign_cc_target (
6667 name = name ,
67- extra_toolchains = [ toolchain ] ,
68+ extra_toolchain = toolchain ,
6869 target = foreign_cc_rule_target_name ,
6970 tags = tags ,
7071 visibility = visibility ,
0 commit comments