From 173de320197ba97f2daf46b7d229055cd3732df4 Mon Sep 17 00:00:00 2001 From: Ryan Trinkle Date: Sat, 21 Dec 2024 19:57:18 -0400 Subject: [PATCH] mkBinaryCache: fix FileHashes --- pkgs/build-support/binary-cache/make-binary-cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/binary-cache/make-binary-cache.py b/pkgs/build-support/binary-cache/make-binary-cache.py index 589d005562b1f..c9a8601259062 100644 --- a/pkgs/build-support/binary-cache/make-binary-cache.py +++ b/pkgs/build-support/binary-cache/make-binary-cache.py @@ -23,7 +23,7 @@ def dropPrefix(path): with open(xzFile, "w") as f: subprocess.run("nix-store --dump %s | xz -c" % item["path"], stdout=f, shell=True) - fileHash = subprocess.run(["nix-hash", "--base32", "--type", "sha256", item["path"]], capture_output=True).stdout.decode().strip() + fileHash = subprocess.run(["nix-hash", "--base32", "--type", "sha256", "--flat", xzFile], capture_output=True).stdout.decode().strip() fileSize = os.path.getsize(xzFile) # Rename the .nar.xz file to its own hash to match "nix copy" behavior