Awesome Bazel
{Fast, Correct} - Choose two
Bazel is an open-source build and test tool similar to Make, Maven, and Gradle. It uses a human-readable, high-level build language. Bazel supports projects in multiple languages and builds outputs for multiple platforms. Bazel supports large codebases across multiple repositories, and large numbers of users. (via docs)
A curated list of Bazel rules, tooling and resources.
Have something to contribute or discuss? Open a pull request or create an issue.
Contents
Rules
Language/Platform | Repository/Documentation |
---|---|
Amazon web services (AWS) | |
Android |
|
AppImage | |
Apple (iOS, macOS, tvOS, watchOS) |
|
ANTLR | |
ARM Mbed OS | |
Bison | |
Blender |
|
BOSH | |
Brotli | |
C++ |
|
C# |
|
Clojure | |
Closure | |
CSS | |
CMake | |
CocoaPods | |
CODEOWNERS | |
D | |
Dart | |
Databricks | |
Docker |
Note: see the OCI containers section below
|
ebook (pdf, epub, mobi) | |
ECS | |
Elm | |
Emacs Lisp (elisp) | |
Emscripten | |
Erlang | |
Flex | |
Go |
|
Graal | |
Grafana | |
Groovy | |
GWT | |
Haskell |
|
Helm (Kubernetes) |
|
Heroku |
|
Homebrew | |
Hugo | |
Idris | |
ISPC | |
Java |
|
JFlex | |
Kotlin | |
Kubernetes |
|
LaTeX | |
LLVM toolchain |
|
M4 | |
Manifest of build artifacts |
|
Maven |
|
Microsoft Azure | |
NativeScript | |
Nixpkgs | |
Node.js / JavaScript |
|
OCaml | |
OCI Containers |
|
OpenAPI/Swagger | |
Packaging (RPM/DEB) | |
Pandoc | |
PHP | |
Prometheus |
|
Protobuf |
|
Purescript | |
Python |
|
Ragel | |
R | |
ReasonML, BuckleScript | |
Ruby | |
Rust |
|
Sass | |
Scala | |
Shell |
|
SonarQube | |
Spring | |
Swift | |
Terraform | |
Twirl | |
TypeScript |
|
Verilog | |
Web (HTML, CSS, JS, assets) |
Tooling
General
- graknlabs/bazel-distribution - Assemble and deploy software distributions to common platforms, e.g. APT, Brew, GitHub, Maven, NPM, PIP, RPM, etc.
- bazelbuild/bazel-watcher - Automatically run Bazel commands when source files change
- nadirizr/dazel - Run Bazel inside a Docker container via a seamless proxy
- spotify/bazel-tools - Spotify's production tools for dealing with very large Bazel-managed repositories.
- atlassian/bazel-tools - Atlassian's reusable bits for Bazel
- gerrit/bazlets - Gerrit's re-usable building blocks for Bazel build tool
- Bazel Code Search - Browse Bazel's codebase with cross references.
- heroku-buildpack-bazel - Heroku buildpack for Bazel
- hchauvin/bazel-coverage-report - A multi-language coverage report generator for Bazel
- acqio/bazel-arcanist - Integration with Arcanist with
arc test
andarc lint
- Asana/bazeltsc - TypeScript compiler that knows how to run as a Bazel persistent worker
- bazelbuild/sandboxfs - A virtual file system for sandboxing
- JetBrains/teamcity-bazel-plugin - TeamCity plugin for Bazel (blogpost)
- philwo/bazelisk - A user-friendly launcher for Bazel
- bzl-io/bzl - a wrapper around the bazel build tool to extend its functionality
- Aspect CLI - a wrapper around Bazel that allows interactivity and plugin extensions
- bazelbuild/bazel-integration-testing - Framework for integration tests that call Bazel
- bazel-diff - Bazel Target Diffing between two revisions in Git, allowing for Test Target Selection and Selective Building
- renovate - Automate WORKSPACE dependencies updates
- bazel-super-formatter - Hermetic aggregation formatter to format code in most languages
- bazel-aquery-differ - View differences between two different aquery invocations.
Toolchains
Toolchains enable authors to decouple their rule logic from platform-based selection of tools.
- bazelbuilds/bazel-toolchains - Bazel toolchain configurations to enable Google Cloud Remote Build Execution via Docker containers
- vsco/bazel-toolchains - A collection of Bazel C++ build infrastructure based on Chromium's LLVM toolchain
- grailbio/bazel-toolchain - LLVM toolchain for bazel
- silvergasp/bazel-embedded - Set of bazel toolchains and tools, for compiling and uploading to embedded targets
Starlark
Starlark (formerly called Skylark) is Bazel's domain-specific language for writing BUILD definitions and rules.
- Official documentation
- Language description
- Starlark in Go
- Starlark in Rust
- Stardoc - Starlark documentation generator
- Sphinx-Bazel - Sphinx extension to read Bazel files to generate documentation (GitHub)
- Skylib - Common useful functions for writing custom build rules with Starlark
- aspect_bazel_lib - More common useful functions for writing custom build rules with Starlark
- Bazel Common Libraries - Java-specific Common functionality for Google's open-source libraries that are built with Bazel.
- Stardbg - A standalone debugger for Starlark
Remote caching and execution
- bazel-remote - A simple remote cache for Bazel that supports HTTP and gRPC, with optional proxy backends for S3/GCS/HTTP.
- bazelbuild/bazel-buildfarm - Self-hosted remote caching and execution service written in Java
- Buildbarn - Self-hosted remote caching and execution service written in Go
- buildbuddy-io/buildbuddy - Cloud or self-hosted remote caching and execution service written in Go, with Web UI for viewing and debugging build logs
- BuildGrid - Self-hosted remote caching and execution service written in Python
- Asana/bazels3cache - Small web server for a Bazel cache that proxies to S3, allowing Bazel to work offline and has async uploads to make Bazel faster.
- EngFlow - Cloud or self-hosted remote caching and execution, with build analytics UI for diagnosing and fixing performance issues, flaky tests, and build failures.
Project generators
Tools for generating WORKSPACE and BUILD files from source code.
- blakefiler.py - Generate a Makefile and tarball-able distribution using
bazel query
- Lavender - Generate Visual Studio projects that uses Bazel for the actual building
- bazel-to-msbuild - Generate Visual Studio solution and projects from bazel workspace, command line tool build by Java.
- Jadep: Java Automated Dependencies - Generate BUILD files automatically for an existing Java project with class dependency analysis.
- BUILD File Generator - Similar tool for existing Java projects.
- Gazelle - BUILD file generator with extensions for many languages. See the list of available plugins in the project README: https://github.com/bazelbuild/bazel-gazelle#supported-languages
- Pazel - Generate Bazel BUILD files for Python
- Tulsi for Xcode - A project generator for Xcode projects
- pinterest/xchammer - XCHammer generates Xcode projects from a Bazel Workspace
- create-bazel-workspace - Generate a new multi-language Bazel workspace with minimal configuration
- @bazel/create - Project generator for NodeJS projects
- llvmbzlgen - Tools for generating Bazel BUILD targets from LLVM CMakeLists
Editors
- IntelliJ plugin (compatible with Android Studio and CLion)
- Eclipse Support
- Bazel Eclipse Feature (BEF) - Fork of the abandoned Google Bazel Eclipse plugin
- B2Eclipse - Bazel Eclipse plugin based on Eclipse JDT LS
- Vim plugin
- Emacs Support
- VSCode Support
- bazelbuild/vscode-bazel
- stackb/bazel-stack-vscode. Includes syntax highlighting / flag completion for bazelrc files. Hover support for inline builtin-function and bazel rule documentation. VSCode Marketplace.
- stackb/bazel-stack-vscode-cc. Supports generation of clang compilation databases. VSCode Marketplace.
- VSCode Bazel Java extension - Proof-of-concept (POC) of a Bazel Java development extension for VS Code
- hedronvision/bazel-compile-commands-extractor enables autocomplete, smart navigation, quick fixes, and more in a wide variety of extensible editors, including VSCode, Vim, Emacs, Atom, and Sublime. It lets language servers, like clangd, ccls, and other types of tooling, draw upon Bazel’s understanding of how
cc
andobjc
code will be compiled, including how it configures cross-compilation for other platforms. - PyCharm
- sconover/rules_intellij_generate - Plugin-less Bazel/IntelliJ integration
- georgewfraser/java-language-server - Java Language Server (LSP) with support for Bazel-built projects
BUILD file tools
bazelbuild/buildtools contains:
- Buildifier - Prettifier for
BUILD
and.bzl
files - Buildozer - Manipulate
BUILD
file contents from the command line - unused_deps - Find unneeded dependencies in BUILD files
Migration
- bazelbuild/migration-tooling - Migrate an existing Maven project to Bazel.
- johnynek/bazel-deps - Generate bazel dependencies transitively for Maven artifacts, with scala support.
- rules_maven - Rules to define Maven dependencies
- bazelize-maven-plugin - Maven plugin for migration from Maven to Bazel
- bazelbuild/gmaven_rules - Transitive WORKSPACE rules for Google's Maven repository
- stripe/sbt-bazel - Easily convert SBT projects to Bazel workspaces
- wix-incubator/exodus - Easily migrate your JVM code from Maven to Bazel
Misc
- salesforce/bazel-maven-proxy - A local proxy to access Maven resources behind secure repositories or from the local repo
Resources
Designs
- bazelbuild/proposals - Index of all design documents and proposals for Bazel.
- Bazel's design process
Documentation
- Bazel rules API documentation, hosted by Aspect
Tutorials
Official
Toolchains
Codelabs
Community
- Aspects: the fan-fic of build rules
- Real-world Bazel - BUILD files collected from public GitHub projects for reference and learning purposes.
- Bazel Lesson 1 and Bazel Lesson 2 - Gradually build a multi-language Bazel project.
- Bazel Mystery - Gamified workspace to learn about Bazel.
- Bazel and Bazel rules tutorials from Jay Conrod, e.g.
Projects
A list of projects built with Bazel:
- bazelment/trunk: A collection of C++/Java OSS with BUILD files. e.g. grpc, guava, netty.
- tensorflow/tensorflow: Computation using data flow graphs for scalable machine learning.
- abseil/abseil-cpp - OSS collection of C++ code (compliant to C++11) designed to augment the C++ standard library.
- GoogleCloudPlatform/distroless - Language focused docker images, minus the operating system.
- google/subpar - Subpar is a utility for creating self-contained python executables. It is designed to work well with Bazel.
- alexeagle/angular-bazel-example: Building an Angular application with Bazel
- ABC: Angular Buildtools Convergence https://g.co/ng/abc
- google/startup-os - Working examples of Google's Open Source tools and Cloud.
- lucperkins/colossus - An example microservice architecture for Kubernetes using Bazel, Go, Java, Docker, Kubernetes, Minikube, Gazelle, gRPC, Prometheus, Grafana, and more.
- squzy/squzy - is a high-performance open-source monitoring system written in Golang with Bazel. Using Bazel for testing, building and dockerize.
Demos
Bazel demo projects:
- kastiglione/bazel-xcode-demo-swift-driver: Demonstrates using Bazel and Xcode, to build apple/swift-driver.
- nickdecooman/bazel-rust-docker-example: Demonstrating Bazel setup for Rust services with Cargo and Docker support.
- kriscfoster/multi-language-bazel-monorepo: Bazel monorepo that includes example golang, python and javascript libraries, binaries and Docker image targets.
- ekhabarov/bazel-k8s-envoy: Build Go gRPC micoservices with Bazel and deploy them to k8s.
Articles
- Build mobile apps with Bazel. Part 2: iOS - Francois Stephany
- Build mobile apps with Bazel. Part 1: Android - Francois Stephany
- (In Japanese) Building C++ with Bazel / C++ビルド環境としてのBazel導入試行
- Nix + Bazel = fully reproducible, incremental builds
- Production Code Splitting With Bazel - Greg Magolan (Google)
- Build large polyglot projects with Bazel... now with Haskell support
- Managing a Go monorepo with Bazel - Filip Nikolovski (InPlayer)
- How to Create a Persistent Worker for Bazel - Mike Morearty (Asana)
- We Switched from Maven to Bazel and Builds Got 10x Faster - Jason Lunz (Redfin)
- Angular Bazel Build With Dev Server - Torgeir "Tor" Helgevold
- Bazel Conference 2017 - Justin Poehnelt
- What Angular is doing with Bazel and Closure
- Building Docker Images Without Docker
- Bazel Golang Hello World
- Migrating from Gradle to Bazel
- Benchmarking the Bazel build system on real-life C++
- Migrating Gypsum and CodeSwitch to Bazel - Jay Conrod (Google)
- Create Go Monorepo with Go-modules and Bazel - Iurii Panarin
Videos
- Bazel Opportunities, Tradeoffs, and Rollout - Kyle Cordes (Oasis Digital)
- code::dive 2020: Introduction to Bazel to build C++ and Python - Xavier Bonaventura (BMW Group)
- KubeCon Europe 2019: Reproducible Development and Deployment with Bazel and Telepresence - Christian Roggia (Engel & Völkers)
- ScalaSphere 2018: Using Bazel to build Scala - Andy Scott (Stripe)
- GopherChina 2018: Bazel build //:Go - Yuan He (流利说/liulishuo.com)
- How I love being ejected: Customizing your Angular build with Bazel - Greg Magolan (Angular team)
- SF Scala: Bazel - a Brief Overview - Ulf Adams (Google)
- Bazel for building Angular applications at Angular Lunch - Kyle Cordes
- Deep Dive of Google's Angular Build Toolchain - Alex Eagle (Google)
- Bazel Conference 2017 Opening Remarks - Helen Altshuler, John Field, Ulf Adams (Google)
- Bazel Remote Execution and Remote Caching w/ Two Sigma and Uber - Alpha Lam (Two Sigma), George Gensure (Uber)
- Tensorflow with Bazel — Lessons Learned - Gunhan Gulsoy (Google)
- Building Real-time Systems with Bazel w/ SpaceX - Matt Sachtler, Patrick Conrad (SpaceX)
- Hacks and Tips for Incremental Adoption of Bazel for iOS w/ Pinterest - Rahul Malik, Brandon Kase, Jerry Marino (Pinterest)
- Front End Development with Bazel: Angular/TypeScript and Persistent Workers w/ Asana - Mike Morearty (Asana), Alex Eagle (Google)
- Scala with Bazel w/ Wix, Stripe, Databricks - Ittai Zeidman (Wix), Oscar Boykin (Stripe), Ahir Reddy (DataBricks)
- Skylark: The Bazel Extensibility Language - Laurent Le Brun (Google)
- Using Bazel for Fast, Correct Docker Deployments w/ Databricks - Miles Yucht (Databricks), Matthew Moore (Google)
- Platforms and Toolchains in Bazel - John Cater (Google)
- Building Kubernetes [a Go binary] with Bazel - Jeff Grafton (Google)
- Integration testing with Bazel w/Dropbox - Benjamin Peterson (Dropbox)
- Bazel Conference 2017 playlist
- GothamGo 2017: A Go implementation of the Skylark Configuration Language - Alan Donovan (Google)
- Bazel: Google's Extensible, Multilingual, Scalable Build System DevTools@Scale2017 - Dmitry Lomov (Google)
- Building Go with Bazel at Golang UK Conference 2017 - Paul Bellamy
- Building Software At Google Scale - Ulf Adams, Helen Altshuler, David Stanke (Google)
- Bazel: Google's own build tool, now publicly available in Beta - Paul Johnston
- Bazel at FrOSCon - Klaus Aehlig (Google)
- Building Python with Bazel - Benjamin Peterson (Dropbox)
- Bazel at the Dart Developer Summit 2016 - Damien Martin-Guillerez (Google)
Podcasts
- Bazel; CppCast Oct 16th, 2020 - Lukács Berki and Julio Merino
- Bazel with Tony Aiuto; Google Cloud Podcast #153 Oct 31st, 2018 - Tony Aiuto
- AiA 247: Bazel with Alex Eagle; Adventures in Angular Jul 9th, 2019 - Alex Eagle (Google)
Books
- Beginning Bazel: Building and Testing for Java, Go, and More - P.J. McNerney; Apress, 1st ed. edition (December 24, 2019) 978-1484251935
- Core Bazel: Fast Builds For Busy People - B. Mustiata; Amazon Kindle (July 28, 2020) ASIN: B08DXBR2TF
- Getting Started with Bazel - B. Muschko; O'Reilly Media (February 2020)
Slides
- Building Gerrit with Bazel at Gerrit User Conference 2016 - David Ostrovsky
Blogs
- Official Bazel Blog
- Kristina Chodorow's blogposts on Bazel
- Envoy as an API Gateway - Build Go microservices with Bazel.
Community
- #bazelbuild on Slack
- BuildTeamWorld on Slack - A community slack for BuildFarm, BuildGrid, Bazel and general build teams.
#bazel
on Freenode- Stack Overflow
- Bazel users mailing list
- Bazel developers mailing list
Misc
- Why Google Stores Billions of Lines of Code in a Single Repository (Video at @Scale 2015)