[CLI] bb specific commands don't work when using `.bazelversion`
brentleyjones opened this issue · comments
Describe the bug
bazel print
doesn't work when using the CLI through .bazelversion
. When invoked directly on the binary it does.
To Reproduce
$ echo "$(echo "buildbuddy-io/5.0.54"; cat .bazelversion)" > .bazelversion
$ bazel print
Starting local Bazel server and connecting to it...
Command 'print' not found. Try 'bazel help'.
$ /Users/brentley.jones/Library/Caches/bazelisk/downloads/sha256/c88b051f9a24623495c0e5bc96a6b819f65757d69a2d005be5175764c5
d9659b/bin/bazel print
usage: bb print [--grpc_log=PATH] [--compact_execution_log=PATH] [--sort=true]
Prints a human-readable representation of log files output by Bazel.
Oh, interesting 🤔
I wonder if the print
subcommand is blocked on the Bazelisk level. Will investigate.
Any update on this?
I can't reproduce this locally on macOS:
$ mkdir bazel-print
$ cd bazel-print
$ touch MODULE.bazel
$ echo "7.1.2" > .bazelversion
$ echo "$(echo "buildbuddy-io/5.0.54"; cat .bazelversion)" > .bazelversion
$ which bazel
$ bazel print
usage: bb print [--grpc_log=PATH] [--compact_execution_log=PATH] [--sort=true]
Prints a human-readable representation of log files output by Bazel.
Currently supported log types:
--grpc_log: Path to a file saved with --experimental_remote_grpc_log.
--compact_execution_log: Path to a file saved with --experimental_execution_log_compact_file.
@brentleyjones What happens if you run these commands? Which version of bazelisk are you using?
Those steps don't fail, but they do in our internal repo. Checking to see what's different. I believe it has to do with using a tools/bazel
wrapper.
Our wrapper adds a bunch of flags to commands that come through, which causes the BB CLI to interpret print
as a bazel command and passes it through. We will fix on our side.