-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: allow attrs accept selects. #1698
Comments
When I think about it, shouldn't rules and aspects also have access to user configuration inputs, like the values of The built-in rules indeed behave differently when these configuration inputs change, so I can't see this being a technical impossibility. Supporting this would make rules closer to their built-in counterparts. |
FYI: Currently one can work around the problem where Similarly, rules and aspects can access various These are tedious, but before the official Bazel team fixes this issue, you can use these tricks to work around the limits. |
Do you have an example that doesn't work and Bazel output? |
@ulfjack Thanks. That's a good question. I revisited this feature request and tested and can confirm that said rules can indeed accept selects. My original intention, however, was to set the default value of an attr to a select. For example:
This fails:
But I wish that could be accepted. |
Thanks for the feature request, that makes sense. The workaround for now is to wrap the rule with a macro, and use the select in the macro. |
This is the same issue as #287. |
Duplicate of #287 |
I tried to put a
select
of lists ofstring
s to arule
'sattr
expecting astring_list
or alabel_list
, but that didn't work. This seems an important feature missing, since withoutselects
we have absolutely no flexibility to writeBUILD
s that work under different configurations.Thanks.
The text was updated successfully, but these errors were encountered: