Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow string_list flags to be set via repeated flag uses #15943

Merged
merged 2 commits into from
Jul 22, 2022

Conversation

ckolli5
Copy link

@ckolli5 ckolli5 commented Jul 21, 2022

For all parts of Bazel other than option parsing, string build setting
flags with allow_multiple = True should behave just like string_list
settings, even though they are fundamentally of a different type. This
requires a lot of special casing all over the code base and also causes
confusing user-facing behavior when transitioning on such settings.

This commit deprecates the allow_multiple named parameter of
config.string and as a replacement introduces a new named parameter
repeatable on config.string_list. Settings with the latter set to True
behave exactly like string settings with allow_multiple = True with
respect to command-line option parsing and exactly like ordinary
string_list flags in all other situations.

Fixes #13817

Closes #14911.

PiperOrigin-RevId: 462146752
Change-Id: I91ddc4328a1b2244f4303fcda7b4228b182a5d56

For all parts of Bazel other than option parsing, string build setting
flags with `allow_multiple = True` should behave just like `string_list`
settings, even though they are fundamentally of a different type. This
requires a lot of special casing all over the code base and also causes
confusing user-facing behavior when transitioning on such settings.

This commit deprecates the `allow_multiple` named parameter of
`config.string` and as a replacement introduces a new named parameter
`repeatable` on `config.string_list`. Settings with the latter set to True
behave exactly like `string` settings with `allow_multiple = True` with
respect to command-line option parsing and exactly like ordinary
`string_list` flags in all other situations.

Fixes bazelbuild#13817

Closes bazelbuild#14911.

PiperOrigin-RevId: 462146752
Change-Id: I91ddc4328a1b2244f4303fcda7b4228b182a5d56
@ckolli5 ckolli5 requested a review from ShreeM01 as a code owner July 21, 2022 17:59
@sgowroji sgowroji merged commit 9c2c3de into bazelbuild:release-5.3.0 Jul 22, 2022
@ckolli5 ckolli5 deleted the ck/cherry_pick_14911 branch July 22, 2022 21:18
@ShreeM01 ShreeM01 added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants