---
title: "Build faster with Buck2: Our open source build system"
description: "Buck2 is Meta's from-scratch rewrite of Buck, open sourced with a Rust core and all language rules written in Starlark, and it completes builds about twice as fast as Buck1 internally."
url: "https://swe.quest/articles/build-faster-with-buck2-our-open-source-build-system-ede49d4bb9123548"
canonical: "https://engineering.fb.com/2023/04/06/open-source/buck2-open-source-large-scale-build-system/"
source: "Meta Engineering"
published: "2023-04-06"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 7
tags: ["build-systems","rust","open-source","developer-productivity"]
---

# Build faster with Buck2: Our open source build system

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2023-04-06, 7 min read, Announcement. Original: [https://engineering.fb.com/2023/04/06/open-source/buck2-open-source-large-scale-build-system/](https://engineering.fb.com/2023/04/06/open-source/buck2-open-source-large-scale-build-system/)

## Summary

Buck2 is Meta's from-scratch rewrite of Buck, open sourced with a Rust core and all language rules written in Starlark, and it completes builds about twice as fast as Buck1 internally. Its speed comes from a single incremental dependency graph held by a persistent daemon instead of separate target/action graph phases, plus Bazel-compatible remote execution and integration with virtual file systems via Watchman and Sapling. New rule primitives make complex patterns safe and efficient: dynamic\_output lets rules run tools like ocamldep and wire dependencies from their output, and transitive-sets (tsets) avoid O(n²) memory for C++ link closures. The open source release is nearly identical to Meta's internal version and is aimed mainly at moderately sized multi-language projects.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)
- [Developer productivity](https://swe.quest/tags/developer-productivity.md) (Engineering practices)

## Prerequisites

- build systems like Bazel ([easy posts on Build systems](https://swe.quest/tags/build-systems.md?difficulty=easy))
- dependency graphs
- incremental builds

## Keywords

Buck2, Buck1, Bazel, Starlark, Superconsole, Watchman, Sapling, Build Systems a la Carte

## Related posts

- [5 Things you didn’t know about Buck2](https://swe.quest/articles/5-things-you-didn-t-know-about-buck2-e7af8905ffa26190.md): Meta Engineering · 2023-10-23 · Easy · 3 min read · Build systems, Rust, Developer tools, Open source
  Buck2, Meta's open-source successor to the Buck build system, completes builds roughly 2x faster than Buck1 in internal tests.
- [Improving machine learning iteration speed with faster application build and packaging](https://swe.quest/articles/improving-machine-learning-iteration-speed-with-faster-application-build-and-76fe5935fe0be272.md): Meta Engineering · 2024-01-29 · Medium · 5 min read · Build systems, Developer productivity, ML platforms, Storage systems, Python
  Meta cut ML engineers' build and packaging overhead by double-digit percentages by tackling build non-determinism, pruning dependencies, and replacing monolithic XAR executables with an incremental Content Addressable Filesystem (CAF).
- [Build better software to build software better](https://swe.quest/articles/build-better-software-to-build-software-better-5c6078f2e1d6c4da.md): Slack Engineering · 2025-11-06 · Medium · 17 min read · Build systems, Developer productivity, CI/CD, Refactoring & migrations, Caching
  Slack cut the 60-minute build pipeline for Quip and Slack Canvas's backend by applying classic software engineering principles (hermetic, idempotent, granular units of work and clean separation of concerns) before adopting Bazel.
- [Enabling Kotlin incremental compilation on Buck2](https://swe.quest/articles/enabling-kotlin-incremental-compilation-on-buck2-bd5307852c0570ff.md): Meta Engineering · 2025-08-26 · Medium · 10 min read · Build systems, Java & JVM, Compilers, Developer productivity, Mobile
  Meta integrated the Kotlin incremental compiler into Buck2 via Kotlin's experimental Build Tools API, making some large Android modules build up to 3x faster and improving incremental build times about 30% for the average developer.
- [Bun v1.1.39](https://swe.quest/articles/bun-v1-1-39-87acf329d791d87e.md): Bun · 2024-12-17 · Medium · 9 min read · JavaScript, Runtimes & VMs, Build systems, Testing, Memory management
  Bun v1.1.39 introduces bun.lock, a human-readable text lockfile that improves git diffs and works with tools like Dependabot and Renovate, and makes cached bun install 30% faster.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
