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

Incorrect handing of duplicated flag names in bazel help flags-as-proto #23632

Open
vogelsgesang opened this issue Sep 16, 2024 · 0 comments
Open
Labels
team-Core Skyframe, bazel query, BEP, options parsing, bazelrc type: bug untriaged

Comments

@vogelsgesang
Copy link

Description of the bug:

There are two flags with the name watchfs (a deprecated startup flag and a build flag). However, the output of bazel help flags-as-proto only lists the deprecated startup flag, the build flag is missing from this dump.

This was reported in salesforce-misc/bazelrc-lsp#2, where a user of the bazelrc language server realized that the language server is showing an incorrect deprecation warning for common watchfs.

The underlying root cause is that emitFlagsAsProtoHelp uses a HashMap indexed by the flag-name to store information about all flags. This does not handle flags with colliding names correctly.

Not sure how to fix this. Either update emitFlagsAsProtoHelp or maybe just remove the deprecated watchfs startup flag for good?

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Run bazel help flags-as-proto, base64-decode the result and interpret it as protobuf. You will see that the watchfs flag is listed only as a startup option, and the entry for the build option is missing.

Which operating system are you running Bazel on?

not relevant

What is the output of bazel info release?

not relevant

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@satyanandak satyanandak added the team-Core Skyframe, bazel query, BEP, options parsing, bazelrc label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Core Skyframe, bazel query, BEP, options parsing, bazelrc type: bug untriaged
Projects
None yet
Development

No branches or pull requests

4 participants