From 88f36d2694840816f01ee1436867533669757437 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 6 Jan 2023 22:19:06 +0200 Subject: gzip: make reproducible when GZIP_NO_TIMESTAMPS is set the logic can be tested with ``` $ GZIP_NO_TIMESTAMPS=1 && echo "${GZIP_NO_TIMESTAMPS:+-n }" -n $ unset GZIP_NO_TIMESTAMPS && echo "${GZIP_NO_TIMESTAMPS:+-n }" ``` --- pkgs/stdenv/generic/setup.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkgs/stdenv') diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index c6cdb6c3df7..4047d8f4ea2 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1348,6 +1348,10 @@ showPhaseFooter() { genericBuild() { + # variable used by our gzip wrapper to add -n. + # gzip is in common-path.nix and is added to nix-shell but we only want to change its behaviour in nix builds. do not move to a setupHook in gzip. + export GZIP_NO_TIMESTAMPS=1 + if [ -f "${buildCommandPath:-}" ]; then source "$buildCommandPath" return -- cgit 1.4.1