Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add support for config_settings in target_compatible_with#29475

Open
keith wants to merge 1 commit into
bazelbuild:masterfrom
keith:ks/add-support-for-config_settings-in-target_compatible_with
Open

Add support for config_settings in target_compatible_with#29475
keith wants to merge 1 commit into
bazelbuild:masterfrom
keith:ks/add-support-for-config_settings-in-target_compatible_with

Conversation

@keith
Copy link
Copy Markdown
Member

@keith keith commented May 5, 2026

Previously you could only put constraint_values directly in
target_compatible_with. Therefore for other configs you had to do
something like:

target_compatible_with = select({
  ":my_config_setting": [],
  "//conditions:default": ["@platforms//:incompatible"],
})

Now you can inline that just like config settings:

target_compatible_with = [":my_config_setting"],

Fixes #21857

@keith keith marked this pull request as ready for review May 5, 2026 16:06
@keith keith requested a review from a team as a code owner May 5, 2026 16:06
@keith keith requested review from dabanki and removed request for a team May 5, 2026 16:06
@keith keith requested a review from katre May 5, 2026 16:06
@github-actions github-actions Bot added team-Configurability platforms, toolchains, cquery, select(), config transitions awaiting-review PR is awaiting review from an assigned reviewer labels May 5, 2026
@github-actions github-actions Bot added the community-reviewed Reviewed by a trusted community contributor label May 5, 2026
Copy link
Copy Markdown
Collaborator

@katre katre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks very much!

@keith keith force-pushed the ks/add-support-for-config_settings-in-target_compatible_with branch from 5b2c727 to d42edc7 Compare May 7, 2026 17:20
Previously you could only put constraint_values directly in
target_compatible_with. Therefore for other configs you had to do
something like:

```bzl
target_compatible_with = select({
  ":my_config_setting": [],
  "//conditions:default": ["@platforms//:incompatible"],
})
```

Now you can inline that just like config settings:

```bzl
target_compatible_with = [":my_config_setting"],
```

Fixes bazelbuild#21857
@keith keith force-pushed the ks/add-support-for-config_settings-in-target_compatible_with branch from d42edc7 to 9f3190f Compare May 7, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer community-reviewed Reviewed by a trusted community contributor team-Configurability platforms, toolchains, cquery, select(), config transitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Syntactic sugar for target_compatible_with a bool_flag, config_setting

3 participants