diff --git a/pkgs/development/tools/build-managers/buck2/default.nix b/pkgs/development/tools/build-managers/buck2/default.nix index 6e8508291309..8bbf3d234e32 100644 --- a/pkgs/development/tools/build-managers/buck2/default.nix +++ b/pkgs/development/tools/build-managers/buck2/default.nix @@ -1,5 +1,4 @@ { fetchurl, lib, stdenv, zstd -, autoPatchelfHook, gcc-unwrapped , testers, buck2 # for passthru.tests }: @@ -27,12 +26,8 @@ let suffix = { x86_64-darwin = "x86_64-apple-darwin"; aarch64-darwin = "aarch64-apple-darwin"; - # TODO (aseipp): there's an aarch64-linux musl build of buck2, but not a - # x86_64-linux musl build. keep things consistent for now and use glibc - # builds for both; but we should fix this in the future to be less fragile; - # we can then remove autoPatchelfHook. - x86_64-linux = "x86_64-unknown-linux-gnu"; - aarch64-linux = "aarch64-unknown-linux-gnu"; + x86_64-linux = "x86_64-unknown-linux-musl"; + aarch64-linux = "aarch64-unknown-linux-musl"; }."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); buck2-version = "2023-07-15"; @@ -48,24 +43,20 @@ stdenv.mkDerivation { version = "unstable-${buck2-version}"; # TODO (aseipp): kill 'unstable' once a non-prerelease is made inherit src; - buildInputs = lib.optionals stdenv.isLinux [ gcc-unwrapped ]; # need libgcc_s.so.1 for patchelf - nativeBuildInputs = [ zstd ] - # TODO (aseipp): move to musl build and nuke this? - ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ]; + nativeBuildInputs = [ zstd ]; + doCheck = true; dontConfigure = true; + dontStrip = true; + unpackPhase = "unzstd ${src} -o ./buck2"; buildPhase = "chmod +x ./buck2"; + checkPhase = "./buck2 --version"; installPhase = '' mkdir -p $out/bin install -D buck2 $out/bin/buck2 ''; - # NOTE (aseipp): use installCheckPhase instead of checkPhase so that - # autoPatchelfHook kicks in first. - doInstallCheck = true; - installCheckPhase = "$out/bin/buck2 --version"; - passthru = { updateScript = ./update.sh; tests = testers.testVersion { diff --git a/pkgs/development/tools/build-managers/buck2/hashes.json b/pkgs/development/tools/build-managers/buck2/hashes.json index 3ad85e2ca7af..2ac572b0e46f 100644 --- a/pkgs/development/tools/build-managers/buck2/hashes.json +++ b/pkgs/development/tools/build-managers/buck2/hashes.json @@ -1,5 +1,5 @@ -{ "x86_64-linux": "sha256-Nkx/GONX867kfU3pKhilIhbi71PRXFwjRVu/3GTpI1M=" +{ "x86_64-linux": "sha256-xd8MZF1xpVYqEDoL3nUBptiFMn9UkgC+zIgfDkDxwfM=" , "x86_64-darwin": "sha256-d8GD7SwCM1gcWILkmSLRY7nq2w9+AMxgbGiWwAK0BAo=" -, "aarch64-linux": "sha256-xSVYx6Go/hBL4fWi1LPkH8bSFVsTtSVfy1eEuaOvQd4=" +, "aarch64-linux": "sha256-zBVgIgQ+tlBUuHwsZB5JmQJtWZ5soKP6//NxkU96xmo=" , "aarch64-darwin": "sha256-jswrwf37/0Rec551mORXYf+s45Nx16OeaRjRS9ROR4E=" } diff --git a/pkgs/development/tools/build-managers/buck2/update.sh b/pkgs/development/tools/build-managers/buck2/update.sh index 528140e4363e..f43d2f5517a7 100755 --- a/pkgs/development/tools/build-managers/buck2/update.sh +++ b/pkgs/development/tools/build-managers/buck2/update.sh @@ -12,9 +12,9 @@ VERSION=$(curl -s https://api.github.com/repos/facebook/buck2/releases \ echo "Latest buck2 prerelease: $VERSION" ARCHS=( - "x86_64-linux:x86_64-unknown-linux-gnu" + "x86_64-linux:x86_64-unknown-linux-musl" "x86_64-darwin:x86_64-apple-darwin" - "aarch64-linux:aarch64-unknown-linux-gnu" + "aarch64-linux:aarch64-unknown-linux-musl" "aarch64-darwin:aarch64-apple-darwin" )