In a recent interview with The Stack, Canva’s CTO Brendan Humphreys spoke enthusiastically about the $42 billion design company’s adoption of Bazel as a build system – describing the open-source build and test tool, first developed at Google, as a “step change from previous build tools” that was helping his team get features to production “very quickly…”
Humphreys isn’t alone in being a Bazel fan: Airbnb, for example, started tracking its journey from Gradle to Bazel (which it has adopted as its “universal build system across backend, web, and iOS”) in late 2024.
Its engineers recently took Airbnb’s largest code repository off Gradle – migrating a “monorepo” hosting “tens of millions of lines of Java, Kotlin, and Scala code that power the vast array of backend services and data pipelines behind airbnb.com” onto Bazel “because it offered three key advantages: speed, reliability, and a uniform build infrastructure layer.”
Airbnb moved to Bazel in part because “building with Gradle was near its limit. We had already vertically scaled to high-end AWS machines on CI and remote development machines for developers of large services.” Builds were getting slow (20 minutes locally for large builds); Bazel was faster and its remote build execution (RBE) workers “are also short-lived, which results in better machine utilization and cost efficiency” it said.
What is Bazel?
Bazel is a build and test tool that supports projects in multiple languages and builds outputs for multiple platforms. It is hardly new (Google first open-sourced it a decade ago, saying it wanted a “heavy emphasis on automated testing and release processes, and language and platform diversity), but has come a long way since version 1.0 landed in 2019.
The examples of both Airbnb and Canva suggest growing enterprise momentum behind the project, which now has over 1,000 contributors.
Adoption was long-plagued by a steep learning curve, the fact that “Bazel support for Windows is rather limited and often not straightforward” as one Google engineer put it in a thread back in 2021 – and critics continue to lament that it is a blunt object that may not suit many developers.
Software engineer Farid Zakaria recently blogged that “after having spent a full-year on a large migration to Bazel, the challenges and hurdles are starkly contrasted with the successful idioms I observed within Google.”
Bazel was built for large organisations intent on building “everything from source and [who] consolidate into large-ish repositories,” he wrote in July.
But “building from source for everything is very orthogonal to how most developers experience development, especially in open-source – unless you are a fan of NixOS. This makes total sense as the cost of setting up a mono-repository for every small effort would be a Herculean task… Unfortunately, as the use of Bazel at $DAYJOB$ continues to expand, I am beginning to see the costs and fallout of this popular approach.”
Zakaria, a principal engineer at Confluent, said “there is no set standard as to when to build from source and when to pull from a third-party artifact repository such as Maven Central across rules, so one may find themselves in at best confusing builds and at worst broken code.”
See also: Is your platform engineering mature enough to need Radius?
Yet to Canva’s CTO “Bazel’s processes understood, very innately, how to minimise the graph of change that needs to be recomputed and recompiled for any one particular change… It’s a step change from previous build tools, and that allows us to do highly iterative development, and tighten those continuous integration loops so we’re getting into production very quickly” as he told The Stack this month.
Airbnb, meanwhile, complained that Gradle tasks have access to the full file system, which can lead to serious unintended consequences at scale.
“One example we ran into was when a developer updated a task to clean up recent files in the /tmp/ directory. This created a race condition with other Gradle tasks that used the /tmp/ directory and caused CI to fail when thousands of Gradle tasks had to be rerun,” its engineers said.
“Bazel solves this issue with sandboxing, which ensures that only specified inputs are available to a build action. If a file isn’t declared as an input, it simply doesn’t exist in the sandboxed environment,” they added.
Check out: KubeVirt: A solution to your VMware problem - and more?
Airbnb now uses it as a uniform build infrastructure layer across repos, after a migration that saw its team encounter all sorts of hiccups, including reluctant developers, and the fact that the monorepo in question had “a large amount of build logic such as code generation owned by multiple teams. These often took the form of Gradle plugins.”
But it’s now using Bazel to underpin, among other functions,
- Remote caching
- Remote build execution
- Affected targets calculation
- Instrumentation & logging from the Build Event Protocol.
The migration, detailed here, took it a striking 4.5 years, but has delivered good outcomes, says Airbnb, including claimed 3–5x faster local build and test times and 2–3x faster deploys to the development environment...
The Stack will be writing a warts-and-all technical deep dive into Bazel ahead of release 9.0 (Mary Branscombe will be taking the lead on this for us) and we welcome your views and experiences. Get in touch here.
Sign up for The Stack
Interviews, insight, intelligence, and exclusive events for digital leaders.
No spam. Unsubscribe anytime.