3
3
load ("//foreign_cc:providers.bzl" , "ForeignCcDepsInfo" )
4
4
5
5
def _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" ]}
7
7
8
8
_extra_toolchains_transition = transition (
9
9
implementation = _extra_toolchains_transition_impl ,
@@ -21,12 +21,13 @@ def _extra_toolchains_transitioned_foreign_cc_target_impl(ctx):
21
21
]
22
22
23
23
extra_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" ,
25
25
implementation = _extra_toolchains_transitioned_foreign_cc_target_impl ,
26
26
cfg = _extra_toolchains_transition ,
27
27
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." ,
30
31
mandatory = True ,
31
32
),
32
33
"target" : attr .label (
@@ -64,7 +65,7 @@ def foreign_cc_rule_variant(name, rule, toolchain, **kwargs):
64
65
65
66
extra_toolchains_transitioned_foreign_cc_target (
66
67
name = name ,
67
- extra_toolchains = [ toolchain ] ,
68
+ extra_toolchain = toolchain ,
68
69
target = foreign_cc_rule_target_name ,
69
70
tags = tags ,
70
71
visibility = visibility ,
0 commit comments