I would like to be able to do the following in a Bazel BUILD file:
alpha( name = "hello world", color = "blue" ) beta( name = "hello again" )
beta are custom rules. I want
beta to be able to access the
color attribute of the
alpha rule, without adding a label attribute. In Bazel query, I can do something like this:
bazel query 'kind(beta, siblings(kind(alpha, //...)))'
which gives me the
beta which is side by side to
alpha. Can I achieve the same somehow from within the implementation function of the
def _beta_rule_impl(ctx): # This does not exist, I wish it did: ctx.siblings(kind='alpha')
I've seen this been done with a label like this
beta( name = "hello again", alpha_link = ":hello world" # explicitly linking )
but I find this a bit verbose, especially since there is a sibling query support.