From 6e01ecd112dce8d8bbe46c839f982892a3ffb589 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 29 May 2017 16:08:56 +0200 Subject: [PATCH] Fix nix-copy-closure test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes client# error: size mismatch importing path ‘/nix/store/ywf5fihjlxwijm6ygh6s0a353b5yvq4d-libidn2-0.16’; expected 0, got 120264 This is mostly an artifact of the NixOS VM test environment, where the Nix database doesn't contain hashes/sizes. http://hydra.nixos.org/build/53537471 --- src/libstore/store-api.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index e6cbd53dc..76ed99422 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -547,6 +547,7 @@ void copyStorePath(ref srcStore, ref dstStore, if (!info->narHash && dontCheckSigs) { auto info2 = make_ref(*info); info2->narHash = hashString(htSHA256, *sink.s); + if (!info->narSize) info2->narSize = sink.s->size(); info = info2; }