-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
string flag with allow_multiple=True represented as string or list depending on the number of times it was used #15653
Comments
Is #13817 related? |
@brentleyjones thank you for connecting this issue with #13817 |
Previously, the default value of a user-defined string setting with `allow_multiple = True`, which is internally represented as a string, was passed to transitions as a string, not a list containing the single string. Fixes bazelbuild#15653
@fmeum I did some testing and found that the issue reproduces for
In other cases I also get the list. |
That matches what I fixed, thanks for confirming. |
A couple more observations:
|
Another something I don't understand at all:
Observation - output from the rule implementation function shows new default values, BUT the output from transition implementation function shows the old values! And those values never change until I shutdown Bazel server. On the next run the updated values are picked up. HUH? |
That sounds pretty bad and wouldn't be covered by my fix. @gregestren Could there be some issue with transition caching related to the default value being encoded as |
Will have to check, thanks for the correctness observation... |
I shrunk the example a bit to reproduce the incrementality bug: https://gist.github.com/gregestren/f9e83396f3543acf3ad1e6a6e156d8f8 Diagnosing the root cause next. Definitely worth prioritizing. I'll probably fork to a new issue on diagnosis. |
Previously, the default value of a user-defined string setting with `allow_multiple = True`, which is internally represented as a string, was passed to transitions as a string, not a list containing the single string. Fixes bazelbuild#15653
Previously, the default value of a user-defined string setting with `allow_multiple = True`, which is internally represented as a string, was passed to transitions as a string, not a list containing the single string. Fixes bazelbuild#15653 Closes bazelbuild#15655. PiperOrigin-RevId: 476375200 Change-Id: Id036f17836e2523aa50c7b026f5397ab0a88952b
Description of the bug:
When such flag is used in transition corresponding setting is string if the flag was used once or it is list if the flag was used more than once.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I provided compact repro here: https://github.com/Bazel-snippets/string_flag
Command to run:
bazel build test
The repro defines two very similar flags:
and
Rule
test
prints the value of both flags and in both cases it is a list.Rule
test
also uses those flags in a transition like this:In this case
string_list_flag
is again a list as it should be, butmultistring_flag
is a string, which is a bug.Interestingly if
multistring_flag
is used more than once on the command line then it is a list too.Expected behavior: it should be a list always.
Which operating system are you running Bazel on?
Mac, Linux, Windows
What is the output of
bazel info release
?5.1.1
The text was updated successfully, but these errors were encountered: