Skip to content

Provide ability to directly select() on constraint_value #8583

@gregestren

Description

@gregestren

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:

Also see #7668 and bazelbuild/bazel-skylib#89 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)team-Configurabilityplatforms, toolchains, cquery, select(), config transitions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions