Bazel
Bazel is an open-source build and test tool developed by Google, similar to Make, Maven, and Gradle. It is designed to handle large, multi-language projects with a focus on speed and reproducibility. It achieves this through heavy caching, parallel execution, and hermetic builds. It uses BUILD files and a Python-like language called Starlark to define build targets.
Bazel is a fast, scalable, and multi-language open-source build and test automation tool
. It was open-sourced by Google in 2015 and is based on the company’s internal build system, known as Blaze.
Key features
- Speed: Bazel accelerates builds by precisely tracking file changes and dependencies, ensuring that it only rebuilds what is necessary. It also runs build and test commands in parallel.
- Scalability: It is designed to handle extremely large codebases, supporting projects with millions of source files and tens of thousands of users.
- Multi-language and multi-platform support: Bazel supports a wide array of languages, such as C++, Java, Python, Go, and Rust. A single tool and the same build files can be used to build software for different platforms, including desktop, server, and mobile (Android and iOS).
- Reproducibility: Builds are “hermetic,” meaning they are isolated from the host machine’s environment and produce the same output every time, regardless of the system they are run on.
- Extensibility: Users can extend Bazel to support any language or framework by writing custom rules using Starlark, a Python-like language.
- Remote execution and caching: Bazel can distribute build and test actions across a remote build farm, dramatically speeding up performance for large projects.
Blaze, the Google internal version
Blaze is Google’s proprietary build system, developed in 2006 to manage the company’s massive, single monorepo. Bazel was released to the public as an open-source version of Blaze, making its capabilities available to the wider software development community.
While Blaze remains the core build tool at Google, used to build nearly all of the company’s software, Bazel is the public, open-source version that is independently developed and maintained. Bazel incorporates many of the same core principles and architecture as Blaze but has its own feature set and release cycle.