-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Provide ability to directly select() on constraint_value #8583
Copy link
Copy link
Closed
Labels
P2We'll consider working on this in future. (Assignee optional)We'll consider working on this in future. (Assignee optional)team-Configurabilityplatforms, toolchains, cquery, select(), config transitionsplatforms, toolchains, cquery, select(), config transitions
Description
Description of the problem / feature request:
A common and annoyingly redundant pattern is:
constraint_value(
name = "my_value",
constraint_setting = "my_setting")
config_setting(
name = "my_value_selectable",
constraint_values = [":my_value"])
some_rule(
...,
attr = select({
":my_value_selectable": ...
})
It would be nice to be able to just write:
some_rule(
...,
attr = select({
":my_value": ...
})
Feature requests: what underlying problem are you trying to solve with this feature?
Unnecessary bloat for situations where config_setting is just abstraction overhead.
Have you found anything relevant by searching the web?
Examples:
- https://github.com/bazelbuild/rules_rust/blob/5ec0b832d6a7a7ad183cfb9fb99ff2cf91429caa/rust/platform/platform.bzl#L59-L67
- https://github.com/bazelbuild/rules_dotnet/blob/07ee724341d5bd70e41c6980ee202a282ccb3462/dotnet/platform/list.bzl#L77-L82
Also see #7668 and bazelbuild/bazel-skylib#89 (comment).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2We'll consider working on this in future. (Assignee optional)We'll consider working on this in future. (Assignee optional)team-Configurabilityplatforms, toolchains, cquery, select(), config transitionsplatforms, toolchains, cquery, select(), config transitions