bazelisk wrapper ♻️
bazelisk is a great wrapper for Bazel,
but you still need to get the appropriate binary for your system.
This is an extra step that each developer needs to do.
So why not wrap the wrapper?
bazelw is a single-file script for both Unix and Windows,
that acts like bazelisk,
but downloads it beforehand if it's not already downloaded.
This way you can just put this script in your repository
and everyone can build your app without worrying about any extra steps.
Click here to download (mark as executable after) or use curl:
curl -O spietras.github.io/bazelw/bazelw && chmod +x bazelwClick here to download or use curl:
curl -O spietras.github.io/bazelw/bazelw.batJust put bazelw (Unix)
and bazelw.bat (Windows)
in your repository and execute whatever you want as you would with bare Bazel.
./bazelw --helpbazelw --helpbazelw only checks if bazelisk binary already exists on your system.
But it might be outdated or it might be some different file just named this way.
You can force bazelw to download the binary
by setting the BAZELW_UPDATE environment variable to anything non-empty.
Since you are here, there is some probability that you might be interested in being able to build your software with the lowest set of dependencies possible.
If you use bazelw then the following dependencies are needed to build anything with Bazel.
Linux:
curlglibcgccor any other C compiler (withCCvariable set)
Windows:
curlMicrosoft Visual C++ RedistributableDeveloper Modeenabled