make-system-tarball: create reproducible tarballs

Ensure that archive members are added in sorted order with a fixed
mtime.  This allows `nix-build --check` to succeed (when building a
tarball of a simple system configuration).

We also remove env-vars which doesn't appear to do much apart from
capture a bunch of store paths we probably don't want.

This is an alternative to
4b78a5b5fb
This commit is contained in:
Joachim Fasting 2016-12-20 15:15:06 +01:00
parent b9d3898995
commit 168fe999e7
No known key found for this signature in database
GPG key ID: 7544761007FE4E08

View file

@ -52,9 +52,10 @@ $extraCommands
mkdir -p $out/tarball mkdir -p $out/tarball
tar cvJf $out/tarball/$fileName.tar.xz * $extraArgs rm env-vars
tar --sort=name --mtime='1970-01-01' -cvJf $out/tarball/$fileName.tar.xz * $extraArgs
mkdir -p $out/nix-support mkdir -p $out/nix-support
echo $system > $out/nix-support/system echo $system > $out/nix-support/system
echo "file system-tarball $out/tarball/$fileName.tar.xz" > $out/nix-support/hydra-build-products echo "file system-tarball $out/tarball/$fileName.tar.xz" > $out/nix-support/hydra-build-products