mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
buck2: 2026-07-15 -> 2026-08-01; include new binary
Include new `starlark_fmt` tool and refactor package definition + update script accordingly.
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
{
|
||||
"aarch64-darwin": {
|
||||
"buck2": "sha256-CIysxyxAD6Q4vkBSw2eC9Wsq+GKHqt8T7OXpdy1yRVw=",
|
||||
"rust-project": "sha256-o5m58wQ9zKkpa5GzgLpcLUV9LpA+n+MxVa/9hH9Tr40="
|
||||
"buck2": "sha256-zol0Uh3MnXg5KUO0+QvBpBYN0t8ylHFl64lRVtgwPxc=",
|
||||
"rust-project": "sha256-3x0wqA5K/30ITQO3Xl3NZW5HnQG9yOBFQr0xI0UGbJo=",
|
||||
"starlark_fmt": "sha256-guJ2EGyaP6WLNSaW9fUPYNM5xU3Ge2AzAM3xAGvrdGI="
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"buck2": "sha256-4jm/cvQKeYfbkCTrbV4yVkL2SWxYnexr5UwQCNJhihk=",
|
||||
"rust-project": "sha256-vGSOwVETwYqwBhkxlSTDJlVcMfbAIzYwDhEKbqz+6ok="
|
||||
"buck2": "sha256-g/HrVfXV3zt7BstOfoZAB9ZArhbxqGq1HpvQKmubck8=",
|
||||
"rust-project": "sha256-vOt/uCO3S5hbXhdq0S7uvKNiszSiTkWMh/hM5CkcOwI=",
|
||||
"starlark_fmt": "sha256-GKsyygMfsGWdBLGv46pyRBeCq3CKqjL5Vi6F+sR1GAY="
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"buck2": "sha256-7MPYB90LD+/xpCNoi9WYJjuDOdIj5oVXiocZZFbBnZU=",
|
||||
"rust-project": "sha256-de0SbH6cbjdDhcPpDTjxBo5HgQ8yS1eokQYjQrHKIDY="
|
||||
"buck2": "sha256-qjBNRxp59pIzsJdn1Lqa3XaQSbejf3ijpxpymDNy9RE=",
|
||||
"rust-project": "sha256-Nr0agbScDlppNlUrJ+YVxTbXBmRlLdzC2f9AYUR2pEs=",
|
||||
"starlark_fmt": "sha256-W7LjUgUhCTlMtiFz9ExmtkWw0hSOUzZKwAF3np9+Qu4="
|
||||
},
|
||||
"version": "2026-07-15",
|
||||
"preludeGit": "caed0b8c0ee137c4e5e1f800a5054df151f490c2",
|
||||
"preludeFod": "sha256-nMHnBf4vQJIxPgarmLPY38b15DFW2FlAQxDCzJgB+w8="
|
||||
"version": "2026-08-01",
|
||||
"preludeGit": "be471f9dd31a45b6c9c1610b1d996455b413b1f6",
|
||||
"preludeFod": "sha256-EqbOUT67jJDx51euhGFWOrLTrZ416Y/ODILsKr5omxE="
|
||||
}
|
||||
|
||||
@@ -52,25 +52,27 @@ let
|
||||
aarch64-linux = "aarch64-unknown-linux-gnu";
|
||||
}
|
||||
.${stdenv.hostPlatform.system};
|
||||
|
||||
binaries = [
|
||||
# the main Buck2 binary
|
||||
"buck2"
|
||||
# provides IDE integration for Buck2 Rust projects
|
||||
"rust-project"
|
||||
# opinionated formatter for Starlark/BUCK files
|
||||
"starlark_fmt"
|
||||
];
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "buck2";
|
||||
version = buildHashes.version;
|
||||
|
||||
srcs = [
|
||||
# the platform-specific binary — which is also
|
||||
# zstd-compressed
|
||||
(fetchurl {
|
||||
url = "https://github.com/facebook/buck2/releases/download/${finalAttrs.version}/buck2-${platform-suffix}.zst";
|
||||
hash = archHashes.buck2;
|
||||
})
|
||||
# rust-project, which is used to provide IDE integration Buck2 Rust projects,
|
||||
# is part of the official distribution
|
||||
(fetchurl {
|
||||
url = "https://github.com/facebook/buck2/releases/download/${finalAttrs.version}/rust-project-${platform-suffix}.zst";
|
||||
hash = archHashes.rust-project;
|
||||
})
|
||||
];
|
||||
srcs = map (
|
||||
binary:
|
||||
fetchurl {
|
||||
url = "https://github.com/facebook/buck2/releases/download/${finalAttrs.version}/${binary}-${platform-suffix}.zst";
|
||||
hash = archHashes.${binary};
|
||||
}
|
||||
) binaries;
|
||||
|
||||
unpackCmd = "unzstd $curSrc -o $(stripHash $curSrc)";
|
||||
sourceRoot = ".";
|
||||
@@ -85,15 +87,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
#225963
|
||||
# https://github.com/NixOS/nixpkgs/issues/225963
|
||||
stdenv.cc.cc.libgcc or null
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -D buck2* "$out/bin/buck2"
|
||||
install -D rust-project* "$out/bin/rust-project"
|
||||
${lib.concatMapStringsSep "\n" (binary: "install -D ${binary}* $out/bin/${binary}") binaries}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
@@ -8,6 +8,7 @@ const ARCHES = [
|
||||
{ name: "aarch64-linux", target: "aarch64-unknown-linux-gnu" },
|
||||
{ name: "aarch64-darwin", target: "aarch64-apple-darwin" },
|
||||
];
|
||||
const BINARIES = ["buck2", "rust-project", "starlark_fmt"]
|
||||
|
||||
const MANIFEST = "pkgs/by-name/bu/buck2/hashes.json"
|
||||
|
||||
@@ -19,30 +20,31 @@ def main [] {
|
||||
| get name
|
||||
|
||||
let preludeHash = http get $"https://github.com/facebook/buck2/releases/download/($version)/prelude_hash" | decode | str trim
|
||||
let preludeFod = run-external "nix" "--extra-experimental-features" "nix-command" "store" "prefetch-file" "--json" $"https://github.com/facebook/buck2-prelude/archive/($preludeHash).tar.gz" | from json | get hash
|
||||
let preludeFod = prefetch-hash $"https://github.com/facebook/buck2-prelude/archive/($preludeHash).tar.gz"
|
||||
|
||||
print $"Newest version: ($version)"
|
||||
print $"Newest prelude hash: ($preludeHash)"
|
||||
|
||||
let hashes = $ARCHES | par-each {
|
||||
|arch|
|
||||
|
||||
{
|
||||
$arch.name: {
|
||||
"buck2": (run-external "nix" "--extra-experimental-features" "nix-command" "store" "prefetch-file" "--json" $"https://github.com/facebook/buck2/releases/download/($version)/buck2-($arch.target).zst" | from json | get hash),
|
||||
"rust-project": (run-external "nix" "--extra-experimental-features" "nix-command" "store" "prefetch-file" "--json" $"https://github.com/facebook/buck2/releases/download/($version)/rust-project-($arch.target).zst" | from json | get hash),
|
||||
let json = $ARCHES
|
||||
| par-each { |arch|
|
||||
{
|
||||
$arch.name: (
|
||||
$BINARIES | each { |binary|
|
||||
{ $binary: (prefetch-hash $"https://github.com/facebook/buck2/releases/download/($version)/($binary)-($arch.target).zst") }
|
||||
} | into record
|
||||
)
|
||||
}
|
||||
}
|
||||
} | reduce { |val, accum| $accum | merge $val }
|
||||
|
||||
let new_manifest = $hashes
|
||||
| into record
|
||||
| sort # keep diffs minimal
|
||||
| insert "version" $version
|
||||
| insert "preludeGit" $preludeHash
|
||||
| insert "preludeFod" $preludeFod
|
||||
| to json
|
||||
|
||||
$new_manifest
|
||||
| to json
|
||||
| append "\n"
|
||||
| str join
|
||||
| save -f $MANIFEST
|
||||
$json + "\n" | save -f $MANIFEST
|
||||
}
|
||||
|
||||
def prefetch-hash [url: string]: nothing -> string {
|
||||
nix --extra-experimental-features nix-command store prefetch-file --json $url | from json | get hash
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user