You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to append a select of Label to a select of list?
#27905
def_my_binary(name, linker_script, additional_linker_inputs, *kwargs):
cc_binary(
name=name,
# What to do here???*kwargs,
)
my_binary=macro(implementation=_my_binary, ..., inherit_attrs=cc_binary)
I want to append linker_script (a Label) to additional_linker_inputs (a list of Labels). But Bazel keeps complaining about selects.
Failed attempts:
additional_linker_inputs = additional_linker_inputs + [linker_script].
Error: Error in cc_binary: expected value of type 'string' for element 0 of attribute 'additional_linker_inputs' of 'cc_binary', but got select
additional_linker_inputs = additional_linker_inputs + linker_script.
Error: Error: Cannot combine incompatible types (select of list, select of Label)
Issue #8419 is related but I don't need to iterate over the select.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm writing a wrapper of
cc_binary:I want to append
linker_script(a Label) toadditional_linker_inputs(a list of Labels). But Bazel keeps complaining aboutselects.Failed attempts:
additional_linker_inputs = additional_linker_inputs + [linker_script].Error:
Error in cc_binary: expected value of type 'string' for element 0 of attribute 'additional_linker_inputs' of 'cc_binary', but got selectadditional_linker_inputs = additional_linker_inputs + linker_script.Error:
Error: Cannot combine incompatible types (select of list, select of Label)Issue #8419 is related but I don't need to iterate over the select.
Any help would be appreciated.
All reactions