From 96cacf01bf840107c3aa491c44a16d8a95e89b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Mon, 3 Nov 2014 22:51:56 +0100 Subject: [PATCH] nix-prefetch-git: run single-threaded 'git repack' Without this, the generated pack files are non-deterministic. I didn't notice this issue in my earlier testing, because my test repo had too few commits for the thread scheduling to take effect. (Test repo had about 10 commits.) --- pkgs/build-support/fetchgit/nix-prefetch-git | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index c4f9a1bf916a..ff84f5adce97 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -226,9 +226,10 @@ make_deterministic_repo(){ fi done - # Do a full repack, for determinism. - # Repack does not add unreferenced objects to a pack file. + # Do a full repack. Must run single-threaded, or else we loose determinism. + git config pack.threads 1 git repack -A -d -f + rm -f .git/config # Garbage collect unreferenced objects. git gc --prune=all