Skip to content

Instantly share code, notes, and snippets.

Managing multiple-versions of Bazel with Homebrew

If you work with multiple repositories that require different versions of Bazel, this guide might help.

Installing a version of Bazel

Homebrew has a mechanism for installing an older version of a particular package. The details are in this Stackoverflow answer for those interested.

The general idea is to find the particular SHA of homebrew-core and install the bazel formula from a particular commit. You can find the history of all Bazel recipe changes in: https://github.com/Homebrew/homebrew-core/commits/master/Formula/bazel.rb.