Facebook parent company Meta has released its Buck2 build system under the MIT open source license. Written in Rust and designed to make the build experience faster and more efficient, Buck2 is being used by thousands of developers at Meta and performing millions of builds per day, the company said.
Open-sourced on April 6 as a faster successor to the Buck1 build system, Buck2 can be accessed from GitHub or from the Buck2 website. The system is capable of building software written in any language, and it can build software written in many languages simultaneously. For example, if developers have a Python binary that imports a Rust library that depends on an OCaml library that depends on a C file, Buck2 can help, Meta said.
A from-scratch rewrite of Buck, Buck2 features a separation of the core and language-specific rules, with increased parallelism, integration with remote execution and virtual file systems, and a redesigned console output. Buck2’s core was written in Rust while the language rules, such as how to build C++, were written in a Rust implementation of Starlark. Separating the language rules from the core makes the rules easier to change and to understand, Meta said. A single dependency graph powers the build system, eliminating many types of bugs and improving parallelism, while the rules API is designed to offer advanced features for performance.
Writing Buck2 in Rust offers advantages such as a lack of garbage collection pauses, whereas Java, which Meta used in writing Buck1, offers advantages such as better profiling tools, Meta said. The Buck2 binary is language-agnostic.
Copyright © 2023 IDG Communications, Inc.