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

bazel help flags-as-proto incorrectly reports has_negative: false for --experimental_convenience_symlinks and --subcommands #24882

Open
tempoz opened this issue Jan 9, 2025 · 0 comments · May be fixed by #24883

Comments

@tempoz
Copy link

tempoz commented Jan 9, 2025

Description of the bug:

bazel help flags-as-proto incorrectly reports has_negative: false for --experimental_convenience_symlinks and --subcommands.

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.

wget https://raw.githubusercontent.com/bazelbuild/bazel/refs/tags/8.0.0/src/main/protobuf/bazel_flags.proto
bazel help flags-as-proto | tail -1 | base64 --decode | protoc --decode bazel_flags.FlagCollection bazel_flags.proto

outputs:

[ other options... ]

flag_infos {
  name: "experimental_convenience_symlinks"
  has_negative_flag: false
  documentation: "This flag controls how the convenience symlinks (the symlinks that appear in the workspace after the build) will be managed. Possible values:\n  normal (default): Each kind of convenience symlink will be created or deleted, as determined by the build.\n  clean: All symlinks will be unconditionally deleted.\n  ignore: Symlinks will not be created or cleaned up.\n  log_only: Generate log messages as if \'normal\' were passed, but don\'t actually performany filesystem operations (useful for tools).\nNote that only symlinks whose names are generated by the current value of --symlink_prefix can be affected; if the prefix changes, any pre-existing symlinks will be left alone."
  commands: "aquery"
  commands: "build"
  commands: "canonicalize-flags"
  commands: "clean"
  commands: "config"
  commands: "coverage"
  commands: "cquery"
  commands: "fetch"
  commands: "info"
  commands: "mobile-install"
  commands: "print_action"
  commands: "run"
  commands: "test"
  commands: "vendor"
  allows_multiple: false
  effect_tags: "AFFECTS_OUTPUTS"
  documentation_category: "OUTPUT_PARAMETERS"
  requires_value: false
}

[ other options... ]

flag_infos {
  name: "subcommands"
  has_negative_flag: false
  documentation: "Display the subcommands executed during a build. Related flags: --execution_log_json_file, --execution_log_binary_file (for logging subcommands to a file in a tool-friendly format)."
  commands: "aquery"
  commands: "build"
  commands: "canonicalize-flags"
  commands: "clean"
  commands: "config"
  commands: "coverage"
  commands: "cquery"
  commands: "fetch"
  commands: "info"
  commands: "mobile-install"
  commands: "print_action"
  commands: "run"
  commands: "test"
  commands: "vendor"
  abbreviation: "s"
  allows_multiple: false
  effect_tags: "TERMINAL_OUTPUT"
  documentation_category: "LOGGING"
  requires_value: false
}

[ other options... ]

This contradicts the bazel documentation here:

--[no]experimental_convenience_symlinks default: "normal"
This flag controls how the convenience symlinks (the symlinks that appear in the workspace after the build) will be managed. Possible values: normal (default): Each kind of convenience symlink will be created or deleted, as determined by the build. clean: All symlinks will be unconditionally deleted. ignore: Symlinks will not be created or cleaned up. log_only: Generate log messages as if 'normal' were passed, but don't actually perform any filesystem operations (useful for tools). Note that only symlinks whose names are generated by the current value of --symlink_prefix can be affected; if the prefix changes, any pre-existing symlinks will be left alone.
Tags: affects_outputs

and here:

--[no]subcommands [-s] default: "false"
Display the subcommands executed during a build. Related flags: --execution_log_json_file, --execution_log_binary_file (for logging subcommands to a file in a tool-friendly format).
Tags: terminal_output

, respectively.

Which operating system are you running Bazel on?

Debian trixie

What is the output of bazel info release?

release 8.0.0

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 ?

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

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 don't think there's anything that searching the web can help with here.

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

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants