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

Get bazelisk version without launching bazel server #440

Open
blackliner opened this issue Mar 20, 2023 · 2 comments
Open

Get bazelisk version without launching bazel server #440

blackliner opened this issue Mar 20, 2023 · 2 comments
Labels
help wanted Needs help from external contributors P2 We'll consider working on this in future. (Assignee optional) type: feature request New feature or request

Comments

@blackliner
Copy link

We are looking for a fast way to determine the version of the bazelisk binary. Calling time bazel version currently prints the following:

Bazelisk version: v1.16.0
WARNING: Invoking Bazel in batch mode since it is not invoked from within a workspace (below a directory having a WORKSPACE file).
Build label: 6.1.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Mar 15 15:44:56 2023 (1678895096)
Build timestamp: 1678895096
Build timestamp as int: 1678895096

real    0m1.372s
user    0m2.208s
sys     0m0.259s

It takes some time for bazel to start the local server, but in our case we do not need to know the bazel version (because we define it via .bazelversion). We only need the first line: Bazelisk version: v1.16.0

@blackliner
Copy link
Author

Any updates here? Even a fresh download of bazelisk has to download bazel before spitting out the bazelisk version

@fweikert fweikert added type: feature request New feature or request help wanted Needs help from external contributors P2 We'll consider working on this in future. (Assignee optional) labels Feb 6, 2024
@mariusz-wlodarczyk
Copy link

mariusz-wlodarczyk commented Sep 19, 2024

BTW. This old #137 issue/feature request, essentially, wants to achieve the same thing.

I was looking for a way to do exactly that, recently. I took a look at the source code and if contributions are accepted I might open a PR since it should be relatively simple to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Needs help from external contributors P2 We'll consider working on this in future. (Assignee optional) type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants