need workaround for transitions on select

20 views
Skip to first unread message

Gregg Reynolds

unread,
Sep 16, 2022, 10:17:28 AM9/16/22
to bazel-discuss
"Starlark rule transitions currently cannot read attributes behind selects."

This is a problem for my rules.  I tried moving the select to a filegroups target, and it worked for selecting source files, but not build targets. Evidently filegroups destroy providers, which makes filegroups unusable for my use case, since I need to propagate dependencies that are carried in providers.

Before I write my own "target_selection" rule, does anybody have a better workaround for this?

More generally, are there plans to remove this restriction?

Thanks,

Gregg

Konstantin

unread,
Nov 12, 2022, 4:54:04 PM11/12/22
to bazel-discuss
I also had this problem and the most strightforward workaround (is it oximoron?) I could think of is to make aspect attribute hidden and by default point it at another rule which can have selectable attributes and just stores what it gets to the custom provider which aspect then can read.

Konstantin

Reply all
Reply to author
Forward
0 new messages