flag_alias and custom flags do not appear in explicit_cmd_line field of OptionsParsed BES message
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
When using a `--flag_alias` or a custom flag on the command line, they do not appear on the `explicit_cmd_line` field of the [OptionsParsed BES message](https://github.com/bazelbuild/bazel/blob/935a2a31cf5458fcc6d7c911f31e35b3ede2e0d4/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto#L404-L412).
Even though these are custom flags, I would expect them to appear in the `explicit_cmd_line` field of OptionsParsed, since the naming of the field suggests that it is exactly the flags passed to the bazel command.
### Which category does this issue belong to?
CLI
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
A sample repo that reproduces the issue can be seen [here](https://github.com/alex-torok/reproduce_bazel_explicit_cmd_line/tree/main).
### Which operating system are you running Bazel on?
linux
### What is the output of `bazel info release`?
release 7.2.1
### 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?
I haven't seen any issue discuss explicit_cmd_line or the OptionsParsed message
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start by reproducing the behavior with the linked sample repository, then read src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto around the OptionsParsed BES message. Trace how explicit_cmd_line is populated for --flag_alias and custom flags; done means both appear in that field when passed on the Bazel command line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100