Bazelisk is a user-friendly launcher for Bazel.
From its project description:
Bazelisk is a wrapper for Bazel written in Go. It automatically picks a good version of Bazel given your current working directory, downloads it from the official server (if required), and then transparently passes through all command-line arguments to the real Bazel binary. You can call it just like you would call Bazel.
The rationales are below:
- Maintaining our own Bazel is kind of a pain (e.g. hard to update to JDK 17).
- Different projects may require different Bazel versions. Using Bazelisk, we can easily specify which Bazel version we want through methods like environment variables (USE_BAZEL_VERSION).
- While Bazelisk does require network: yes to download Bazel, if a package uses Bazel to build it's almost guaranteed to fetch Bazel rules from the internet so we would need network: yes anyway.
- This is also true for Bazel, but I'd like to mention it here because it seems to often get ignored: Bazel does NOT require a JDK/JRE runtime to run. It has its built-in runtime in the executable itself. We don't need to worry about JDK versions at all.
- It is the officially recommended way to get Bazel, kind of like rustup for Rust or ghcup for GHC.
I'm glad to take responsibility for this task if accepted.