From c67586f7d32c945ea0209731d118cee2ebbcf029 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 2 Aug 2026 08:31:18 +0100 Subject: [PATCH] unity-test: fix unstable patch hashes Without the change the attempt to refetch patches fails with hash mismatch: ```` $ nix build --no-link -f. unity-test.patches --rebuild error: hash mismatch in fixed-output derivation '/nix/store/h81wmb8js5h1g2is5bzisf6b9d36arxc-771.patch.drv': specified: sha256-r8ldVb7WrzVwTC2CtGul9Jk4Rzt+6ejk+paYAfFlR5M= got: sha256-viNwaqZ+hjIY4qnlLN55/TMzqmoNAgc1Eq5Yv17tr7c= ``` It happens because repository now adds one extra digit to abbreviated hash: ```diff diff -U0 before after @@ -2 +2 @@ -index 6585129c..9489aef4 100644 +index 6585129c9..9489aef48 100644 ``` Let's use `?full_index=1` to use full hash in diff output. --- pkgs/by-name/un/unity-test/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/un/unity-test/package.nix b/pkgs/by-name/un/unity-test/package.nix index b8b671441320..dd228eeef1c2 100644 --- a/pkgs/by-name/un/unity-test/package.nix +++ b/pkgs/by-name/un/unity-test/package.nix @@ -44,13 +44,13 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # The meson file does not have the subdir set correctly (fetchpatch2 { - url = "https://patch-diff.githubusercontent.com/raw/ThrowTheSwitch/Unity/pull/771.patch"; - hash = "sha256-r8ldVb7WrzVwTC2CtGul9Jk4Rzt+6ejk+paYAfFlR5M="; + url = "https://patch-diff.githubusercontent.com/raw/ThrowTheSwitch/Unity/pull/771.patch?full_index=1"; + hash = "sha256-b1TGYkqeAVbYftN5/YBdiFB7EsSh56S8PCx53fY8lDo="; }) # Fix up the shebangs in the auto directory as not all are correct (fetchpatch2 { - url = "https://patch-diff.githubusercontent.com/raw/ThrowTheSwitch/Unity/pull/790.patch"; - hash = "sha256-K+OxMe/ZMXPPjZXjGhgc5ULLN7plBwL0hV5gwmgA3FM="; + url = "https://patch-diff.githubusercontent.com/raw/ThrowTheSwitch/Unity/pull/790.patch?full_index=1"; + hash = "sha256-N3DVkSuhZUA+9RIynPwuISf4XkVSA2eNqJqrt67XOhA="; }) ];