facebook / buck2

Build system, successor to Buck
https://buck2.build/
Apache License 2.0
3.38k stars 200 forks source link
# Buck2: fast multi-language build system ![Version] ![License] [![Build Status]][CI] [Version]: https://img.shields.io/badge/release-unstable,%20"Developer%20Edition"-orange.svg [License]: https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blueviolet.svg [Build Status]: https://github.com/facebook/buck2/actions/workflows/build-and-test.yml/badge.svg [CI]: https://github.com/facebook/buck2/actions/workflows/build-and-test.yml Homepage  •  Getting Started  •  Contributing ---

Buck2 is a fast, hermetic, multi-language build system, and a direct successor to the original Buck build system ("Buck1") — both designed by Meta.

But what do those words really mean for a build system — and why might they interest you? "But why Buck2?" you might ask, when so many build systems already exist?

[^perf-note]: This number comes from internal usage of Buck1 versus Buck2 at Meta. Please note that appropriate comparisons with systems like Bazel have yet to be performed; Buck1 is the baseline because it's simply what existed and what had to be replaced. Please benchmark Buck2 against your favorite tools and let us know how it goes!

[^hermetic-re-only]: Buck2 currently does not sandbox local-only build steps; in contrast, Buck2 using Remote Execution is always hermetic by design. The vast majority of build rules are remote compatible, as well. Despite that, we hope to lift this restriction in the (hopefully short-term) future so that local-only builds are hermetic as well.

If you're familiar with systems like Buck1, Bazel, or Pants — then Buck2 will feel warm and cozy, and these ideas will be familiar. But then why create Buck2 if those already exist? Because that isn't all — the page "Why Buck2?" on our website goes into more detail on several other important design critera that separate Buck2 from the rest of the pack, including:

If these headline features make you interested — check out the Getting Started guide!

🚧🚧🚧 Warning 🚧🚧🚧 — rough terrain lies ahead

Buck2 was released recently and currently does not have a stable release tag at this time. Pre-release tags/binaries, and stable tags/binaries, will come at later dates. Despite that, it is used extensively inside of Meta on vast amounts of code every day, and buck2-prelude is the same code used internally for all these builds, as well.

Meta just uses the latest committed HEAD version of Buck2 at all times. Your mileage may vary — but at the moment, tracking HEAD is ideal for submitting bug reports and catching regressions.

The short of this is that you should consider this project and its code to be battle-tested and working, but outside consumers will encounter quite a lot of rough edges right now — several features are missing or in progress, some toolchains from Buck1 are missing, and you'll probably have to fiddle with things more than necessary to get it nice and polished.

Please provide feedback by submitting issues and questions!

Installing Buck2

You can get started by downloading the latest buck2 binary for your platform. The latest tag always refers to a recent commit; it is updated on every single push to the GitHub repository, so it will always be a recent version.

You can also compile Buck2 from source, if a binary isn't immediately available for your use; check out the HACKING.md file for information.

Terminology conventions

Frequently used terms and their definitions can be found on the glossary page.

License

Buck2 is licensed under both the MIT license and Apache-2.0 license; the exact terms can be found in the LICENSE-MIT and LICENSE-APACHE files, respectively.