Skip to content

facebook/buck2

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Summary:
* add a basic github action job that runs on push to `main`.
  * inspired by the workflow from a reddit thread: https://www.reddit.com/r/rust/comments/12dphrq/comment/jf89urm/
* build a bunch of buck2 and upload as artifacts, they are by default retained for 90 days
* good
  * binaries uploaded and marked with target triple
* could be improved
  * users will have to go to the latest action page to find the artifact. trying to figure out how to best point users to it (there should be a link to the latest job off of main)
  * on macos getting the binary to run was a bit clunky (had to chmod, open and confirm it's safe etc)
* note for myself: I can't tell if the rust cache is working properly so trying to read up on it / monitor

Reviewed By: ndmitchell

Differential Revision: D44791506

fbshipit-source-id: b94d4d22b2ba14938f160a1fc1f04733366ea32a
798d6cc

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
December 1, 2022 03:11
March 31, 2023 13:03
April 7, 2023 11:27
April 3, 2023 13:46
April 6, 2023 18:00
March 14, 2023 16:39
December 1, 2022 03:11
December 20, 2022 10:16
April 4, 2023 04:12
December 1, 2022 03:11
December 1, 2022 03:11
December 1, 2022 03:11
December 1, 2022 03:11
March 18, 2023 20:38
December 1, 2022 03:11

Buck2 CI

This repo contains the code for the Buck2 build system - the successor to the original Buck build system.

We're keen for you to give Buck2 a go and let us know any problems you run into.

Getting started

Buck2 is written in Rust, which requires rustup to compile.

You can either build buck2 from a clone of the Buck2 repo:

git clone https://github.com/facebook/buck2.git
cd buck2/
cargo install --path=app/buck2

Or alternatively install it directly from GitHub:

rustup install nightly-2023-01-24
cargo +nightly-2023-01-24 install --git https://github.com/facebook/buck2.git buck2

Build uses prebuilt protoc binary from protoc-bin-vendored crate. If these binaries to do not work on your machine (for example, when building for NixOS), path to protoc binary and protobuf include path can be specified via BUCK2_BUILD_PROTOC and BUCK2_BUILD_PROTOC_INCLUDE environment variables.

To build a project with buck2, go to the getting started guide.

Terminology conventions

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

Coding conventions

Beyond the obvious (well-tested, easy to read) we prefer guidelines that are automatically enforced, e.g. through rust fmt, Clippy or the custom linter we have written. Some rules:

  • Use the utilities from Gazebo where they are useful, in particular, dupe.
  • Prefer to_owned to convert &str to String.
  • Qualify anyhow::Result rather than use anyhow::Result.
  • Most errors should be returned as anyhow::Result. Inspecting errors outside tests and the top-level error handler is strongly discouraged.
  • Most errors should be constructed with thiserror deriving enum values, not raw anyhow!.
  • We use the derivative library to derive the PartialEq and Hash traits when some fields should be ignored.
  • Prefer use crate::foo::bar over use super::bar or use crate::foo::*, apart from test modules which often have use super::* at the top.
  • Modules should either have submodules or types/functions/constants, but not both.
  • Prefer anyhow::Error for checking internal invariants that are maintained between multiple files, while panic!/unreachable! are reasonable if the invariant is file-local.

Error messages

  • Names (of variables, targets, files, etc) should be quoted with backticks, e.g. Variable `x` not defined.
  • Lists should use square brackets, e.g. Available targets: [`aa`, `bb`].
  • Error messages should start with an upper case letter. Error messages should not end with a period.

License

Buck2 is both MIT and Apache License, Version 2.0 licensed, as found in the LICENSE-MIT and LICENSE-APACHE files.

About

Build system, successor to Buck

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published