Open source build system Buck2 released

It seems that the engineers of Meta have not been idle recently. They just open sourced the AI ​​​​image segmentation model two days ago, and then released an open source construction system called Buck2.

Buck2 is a large build system that has been in use within Meta for some time, currently being used by thousands of developers at Meta, performing millions of builds per day. In Meta's internal tests, Buck2 completed builds twice as fast as Buck1.

Although Buck2 uses the same name as Buck1 and is also the successor of the Buck1 build system, the former is not a simple upgrade of the latter. Buck2 is completely rewritten in Rust (Buck1 uses Java), and the goal is to make the build faster. More effective.

Because of this, Buck2 has a separate GitHub repository and a separate official website, in order to distinguish it from Buck1.

Our own internal analysis shows that when Buck2 performs builds, engineers are able to generate more meaningful code, and we hope the wider industry benefits as well.

The design of Buck2 is based on the following principles:

  • Complete separation of core and language-specific rules. Separating the language rules from the core means that the rules are easier to change and understand. Buck2's core is written in Rust, and its language rules (such as how to build C++) are written in Starlark. This separation is in contrast to Buck1 (where all rules are written in the core) and Bazel (where C++/Java is written in the core).
  • The build system eliminates many types of errors and increases parallelism.
  • The rules API is designed to include advanced performance features, as well as dynamic dependency features.
  • The open source version is nearly identical to Meta's internal version, with the only parts replaced being the toolchain (pointing to Meta's internal copy of the compiler) and remote execution (pointing to Meta's internal server) -- both of which provide open source alternatives. All rules are also published exactly as for internal use.
  • Buck2 was written to integrate with remote execution, able to run operations on remote machines, uses the same API as Bazel, and has been testing remote execution with Buildbarn and EngFlow.
  • Buck2 can also integrate with virtual file systems.

All of these changes above are intended to help engineers and developers spend less time waiting and more time iterating on their code.

Buck2 currently ships with rules for the following languages: Assembly, C/C++, Erlang, Go, Haskell, Java, JavaScript, Julia, OCaml, Python, and Rust. Developers can  add or reimplement language rules to Buck2 using the Starlark scripting language.

 

Guess you like

Origin blog.csdn.net/u014389734/article/details/130285902