Meta has released its Buck2 build system under the MIT open source license, InfoWorld reports. Buck2 is written in the Rust programming language and is designed to make the build process faster and more efficient. The company says the system is used by thousands of developers at Meta and performs millions of builds per day.
Buck2 can be accessed from GitHub or from the Buck2 website. The system can build software written in any language, and 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 them, Meta says.
Buck2 is a completely rewritten Buck, with a separation of kernel and language-specific rules, increased parallelism, integration with remote execution and virtual file systems, and revised console output.
Buck2’s kernel is written in Rust, while language-specific rules, such as how to build C++, are written in Starlark’s Rust implementation. According to Meta, separating the language rules from the kernel makes it easier to change and understand the rules. A single dependency graph powers the build system, eliminating many types of errors and improving parallelism, while the rules API is designed to offer advanced performance features.
Choosing Rust offers advantages such as no breaks for garbage collection, while Java, which Meta used when writing Buck1, offers advantages such as better profiling tools, Meta says. The Buck2 binary is language agnostic.