Skip to content

Commit

Permalink
Append buck2 toolchain with additional packages (#1264)
Browse files Browse the repository at this point in the history
A toolchain for buck2 depends on more than llvm and rust,
appending more packages for compiling buck2 using remote
execution on nativelink. This mirrors similar to what is
used in [buck2/flake.nix](https://github.com/facebook/buck2/blob/main/flake.nix)

`create-worker-experimental.nix` now flattens out the container
image layout to a standard unix filesystem layout. Using the
nix store layout requires client knowledge of toolchains and
a similar setup as rbe gen/local remote execution which isn't
available at the moment.
  • Loading branch information
adam-singer authored Aug 15, 2024
1 parent 9c87370 commit 042f4a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 11 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,28 @@
createWorker = pkgs.callPackage ./tools/create-worker.nix {inherit buildImage self;};
buck2-toolchain = let
buck2-nightly-rust-version = "2024-04-28";
buck2-nightly-rust =
if pkgs.stdenv.isDarwin
then pkgs.rust-bin.nightly.${buck2-nightly-rust-version}
else pkgs.pkgsMusl.rust-bin.nightly.${buck2-nightly-rust-version};
buck2-nightly-rust = pkgs.rust-bin.nightly.${buck2-nightly-rust-version};
buck2-rust = buck2-nightly-rust.default.override {extensions = ["rust-src"];};
in
pkgs.callPackage ./tools/create-worker-experimental.nix {
inherit buildImage self;
imageName = "buck2-toolchain";
packagesForImage = [
pkgs.coreutils
pkgs.bash
pkgs.clang
pkgs.go
pkgs.diffutils
pkgs.gnutar
pkgs.gzip
buck2-nightly-rust.default
pkgs.python3Full
pkgs.unzip
pkgs.zstd
pkgs.cargo-bloat
pkgs.mold-wrapped
pkgs.reindeer
pkgs.lld_16
pkgs.clang_16
buck2-rust
];
};
siso-chromium = buildImage {
Expand Down
4 changes: 3 additions & 1 deletion tools/create-worker-experimental.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ in
(buildEnv {
name = "${imageName}-buildEnv";
paths = packagesForImage;
pathsToLink = ["/bin"];
# Explicitly flatten out the paths to link as
# laid out in the packages.
pathsToLink = "/";
})
];

Expand Down

0 comments on commit 042f4a5

Please sign in to comment.