summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2014-11-03 22:51:56 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2014-11-03 22:52:57 +0100
commit96cacf01bf840107c3aa491c44a16d8a95e89b05 (patch)
treeb84c586362e85bee373cd6fa012c387cff963b08 /pkgs/build-support
parentf891bc78d15d22442ab1311b7a740562020352fe (diff)
downloadnixlib-96cacf01bf840107c3aa491c44a16d8a95e89b05.tar
nixlib-96cacf01bf840107c3aa491c44a16d8a95e89b05.tar.gz
nixlib-96cacf01bf840107c3aa491c44a16d8a95e89b05.tar.bz2
nixlib-96cacf01bf840107c3aa491c44a16d8a95e89b05.tar.lz
nixlib-96cacf01bf840107c3aa491c44a16d8a95e89b05.tar.xz
nixlib-96cacf01bf840107c3aa491c44a16d8a95e89b05.tar.zst
nixlib-96cacf01bf840107c3aa491c44a16d8a95e89b05.zip
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.)
Diffstat (limited to 'pkgs/build-support')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git5
1 files 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