Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 4a6d2ed

Browse files
merge: #2393
2393: Use upstream buck2 from nixpkgs (ENG-1696) r=nickgerace a=nickgerace Enabled by the following PR: NixOS/nixpkgs#243148 <img src="https://media3.giphy.com/media/xiqeqfNuUMwb1ma26f/giphy.gif"/> Co-authored-by: Nick Gerace <nick@systeminit.com>
2 parents 9c0fe4c + 1e08dc4 commit 4a6d2ed

2 files changed

Lines changed: 9 additions & 63 deletions

File tree

flake.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -33,60 +33,6 @@
3333
extensions = [ "rust-analyzer" "rust-src" ];
3434
};
3535

36-
# Pending an upstream Buck2 package we download pre-built system binaries.
37-
# References: https://github.com/NixOS/nixpkgs/issues/226677
38-
buck2 = pkgs.stdenv.mkDerivation rec {
39-
# These are the primary variables to control the "version" of Buck2 that we want from S3.
40-
#
41-
# To upload the latest objects and get the hashes needed for this flake, run the update
42-
# script from the support directory via Buck2 itself. You can run that target again to
43-
# find the hashes, even if the objects have already been uploaded.
44-
45-
releaseDate = "2023-06-29";
46-
hash = {
47-
"x86_64-linux" = "sha256-uCIbLPms8Ees8SYFZgMuDBKcd2AVdRES/AOzkuCbl1o=";
48-
"aarch64-linux" = "sha256-2f1MOzw+maXlw75Qfd9YIOF4447PuU+seHHGOJ2als0=";
49-
"x86_64-darwin" = "sha256-UFez/5wucCv54riuhsQKCw9EfyUW7xdacbYTVi9ZQ1U=";
50-
"aarch64-darwin" = "sha256-pm9tf3aLllwq5ov3Fg9Umy25mpewGhBEjP5xSBzmFfQ=";
51-
}.${system};
52-
53-
pname = "buck2";
54-
version = "unstable-${releaseDate}";
55-
56-
nativeBuildInputs = with pkgs; [ zstd ];
57-
58-
triple = {
59-
"x86_64-linux" = "x86_64-unknown-linux-gnu";
60-
"aarch64-linux" = "aarch64-unknown-linux-gnu";
61-
"x86_64-darwin" = "x86_64-apple-darwin";
62-
"aarch64-darwin" = "aarch64-apple-darwin";
63-
}.${system};
64-
65-
urlPrefix = "https://buck2-binaries.s3.us-east-2.amazonaws.com/${releaseDate}";
66-
archiveName = "buck2-${triple}.zst";
67-
68-
src = pkgs.fetchurl {
69-
url = "${urlPrefix}/${archiveName}";
70-
sha256 = hash;
71-
};
72-
73-
unpackPhase = ":";
74-
sourceRoot = ".";
75-
76-
installPhase = ''
77-
mkdir -p $out/bin
78-
zstd -d ${src} -o buck2
79-
install -m755 -D buck2 $out/bin/buck2
80-
'';
81-
82-
fixupPhase = if pkgs.stdenv.isLinux then ''
83-
patchelf \
84-
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
85-
$out/bin/buck2
86-
'' else
87-
"";
88-
};
89-
9036
in with pkgs; {
9137
devShells.default = mkShell {
9238
packages = [

0 commit comments

Comments
 (0)