From 062011c52d3794a9dc4eebd46a67c0ff551b198e Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Mon, 21 Oct 2024 17:48:14 -0700 Subject: [PATCH] bant: 0.1.7 fix changed hash of fixed derivation. The hash of the fixed derivation changed If the old derivation with the hash was cached on the system, the build failed with: ``` ERROR: /build/output/external/googletest~1.14.0.bcr.1/BUILD.bazel:80:11: Compiling googletest/src/gtest.cc failed: The include path '/nix/store/p5w6cmwqfvhyaf4vjr7jb18a90icrrr2-openjdk-21.0.3+9/include' references a path outside of the execution root. ERROR: /build/output/external/abseil-cpp~20240116.2/absl/base/BUILD.bazel:755:11: Compiling absl/base/internal/strerror.cc failed: The include path '/nix/store/p5w6cmwqfvhyaf4vjr7jb18a90icrrr2-openjdk-21.0.3+9/include' references a path outside of the execution root. ``` This indicates that the derivation also bakes in the path of the used JDK, which apparently changed since last time. Quick fix for now: adapt hash, but hopefully there could be a more long-term solution. --- pkgs/by-name/ba/bant/package.nix | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ba/bant/package.nix b/pkgs/by-name/ba/bant/package.nix index 3fc5138912a2..c0f181dd41db 100644 --- a/pkgs/by-name/ba/bant/package.nix +++ b/pkgs/by-name/ba/bant/package.nix @@ -15,7 +15,8 @@ let rev = "40bc9ad53e5a59d596935839e7c072679e706266"; hash = "sha256-CL0YMQd1ck6/dlvJCLxt9jYyqDuk+iAWfdBOMj864u8="; }; -in buildBazelPackage rec { +in +buildBazelPackage rec { pname = "bant"; version = "0.1.7"; @@ -26,17 +27,22 @@ in buildBazelPackage rec { hash = "sha256-QbxPosjlrpxbz6gQKUKccF2Gu/i5xvqh2gwfABYE8kE="; }; - bazelFlags = ["--registry" "file://${registry}"]; + bazelFlags = [ + "--registry" + "file://${registry}" + ]; postPatch = '' patchShebangs scripts/create-workspace-status.sh ''; fetchAttrs = { - sha256 = { - aarch64-linux = "sha256-09RL0tj6xsGEmuv11V81eAtqLc9nAaE8Il3d6ueS0UQ="; - x86_64-linux = "sha256-6mlaJ/kT14vKvlJjxqBK/lESjjxbcYxApi7+eiiI37M="; - }.${system} or (throw "No hash for system: ${system}"); + hash = + { + aarch64-linux = "sha256-LNca4h4yceSgve9GYUoXqlODKPjLAa71kh1BWXqRYtk="; + x86_64-linux = "sha256-bRFIfaVbsU2WroXR/i0E7J4rWeaNEoum93r8qOMXXvc="; + } + .${system} or (throw "No hash for system: ${system}"); }; nativeBuildInputs = [ @@ -58,7 +64,10 @@ in buildBazelPackage rec { description = "Bazel/Build Analysis and Navigation Tool"; homepage = "http://bant.build/"; license = licenses.gpl2Only; - maintainers = with maintainers; [ hzeller lromor ]; + maintainers = with maintainers; [ + hzeller + lromor + ]; platforms = platforms.linux; }; }