From f4553d721972e6a437c9f367af2bb0967b773998 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 26 Jan 2016 16:21:43 +0100 Subject: [PATCH] defaultUnpack: Preserve timestamps when copying files Commit 6d928ab684327e0eeb1bf6cd889d57ca7127e8a7 changed this to not preserve timestamps. However, that results in non-determinism; in particular, it gives us a broken $SOURCE_DATE_EPOCH (especially for everything using fetchFromGitHub). Builds affected by timestamps < 1980 should be fixed in some other way (e.g. changing the timestamp to some fixed date > 1980). --- pkgs/stdenv/generic/setup.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index d8de9ab2390..102a8f2f71c 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -480,9 +480,11 @@ _defaultUnpack() { if [ -d "$fn" ]; then stripHash "$fn" - # We can't preserve hardlinks because they may have been introduced by - # store optimization, which might break things in the build - cp -pr --reflink=auto --no-preserve=timestamps "$fn" $strippedName + + # We can't preserve hardlinks because they may have been + # introduced by store optimization, which might break things + # in the build. + cp -pr --reflink=auto "$fn" $strippedName else