Laurent Knauss Software Engineer
Bazel illustration

Bazel is a powerful build tool developed by Google, designed to support large codebases across multiple languages and platforms. It is known for its speed, correctness, and reproducibility.

Key Features

  • Fast and incremental builds
  • Multi-language support (Java, C++, Go, Python, etc.)
  • Hermetic builds for reproducibility
  • Scalable to very large codebases

How does Bazel work?

Bazel uses a directed acyclic graph (DAG) to model build dependencies. Each node represents a build target, and edges represent dependencies. Bazel only rebuilds what is necessary, making builds fast and efficient.

Typical Workflow

  1. Define build targets in BUILD files.
  2. Run bazel build //target to build a specific target.
  3. Bazel analyzes dependencies and builds only what has changed.

Advantages

  • Consistent and reproducible builds
  • Efficient caching and remote execution
  • Open source and widely adopted