Skip to content

Conversation

@abishekgiri
Copy link

What does this PR do?

This PR adds missing reference documentation for the label_flag and label_setting
rules in site/en/extending/config.md.

These rules are currently mentioned in the documentation, but do not have a
clear description of their purpose, attributes, or usage.


What’s included?

  • Expanded documentation in the Label-typed build settings section
  • Clear explanations of:
    • label_flag
    • label_setting
  • A description of how these rules are used for configuration and transitions
  • A list of supported attributes:
    • name
    • build_setting_default
    • visibility
  • A minimal example showing how to define and reference them

Why is this useful?

Users encountering label_flag and label_setting currently need to inspect
rule definitions or source code to understand how they work.

This change provides a concise reference-style explanation consistent with
other build setting documentation and improves discoverability for users
extending Bazel configuration.


Verification

  • Manually reviewed the updated documentation for clarity and consistency
    with existing sections
  • Verified that examples follow current Bazel syntax and documentation style

Fixes #16128

@github-actions github-actions bot added team-Documentation Documentation improvements that cannot be directly linked to other team labels awaiting-review PR is awaiting review from an assigned reviewer labels Jan 26, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds valuable documentation for the label_flag and label_setting rules, which was previously missing. The added content, including the example for label_flag, is clear and helpful. I have one suggestion to clarify the distinction between label_flag and label_setting regarding command-line configuration to prevent potential user confusion.


#### `label_flag` and `label_setting` {:#label-flag-setting}

These rules serve as label-typed build settings used for transitions and command-line configuration. They function as aliases that can be redirected by the configuration.

Choose a reason for hiding this comment

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

high

This sentence is slightly misleading. While both label_flag and label_setting are label-typed build settings, only label_flag can be configured on the command line. label_setting is meant for internal configuration, for example via transitions. It would be clearer to explicitly state this difference.

Suggested change
These rules serve as label-typed build settings used for transitions and command-line configuration. They function as aliases that can be redirected by the configuration.
These rules are label-typed build settings. `label_flag` can be set on the command line, while `label_setting` is for internal configuration (e.g. via transitions). Both function as aliases that can be redirected by the configuration.

@iancha1992 iancha1992 added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Jan 27, 2026
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 team-Configurability platforms, toolchains, cquery, select(), config transitions team-Documentation Documentation improvements that cannot be directly linked to other team labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The label_flag, label_setting rules have no reference documentation

2 participants