summaryrefslogtreecommitdiff
path: root/guix/build/gnu-build-system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-01-05 15:49:48 +0100
committerLudovic Courtès <ludo@gnu.org>2016-01-05 15:52:42 +0100
commit0beb65b45063ccd47b85ed79cc4782f3a3ffa299 (patch)
treec233a477b8d576fc1b9fd9db5cb721043de5a322 /guix/build/gnu-build-system.scm
parente8e2e18b84eb8842a59be9bf7d49bb672260ae3a (diff)
downloadguix-patches-0beb65b45063ccd47b85ed79cc4782f3a3ffa299.tar
guix-patches-0beb65b45063ccd47b85ed79cc4782f3a3ffa299.tar.gz
build-system/gnu: Add 'set-SOURCE-DATE-EPOCH' phase.
This phase is inherited by other build systems, which ensures 'SOURCE_DATE_EPOCH' is always set in practice. * guix/build/python-build-system.scm (set-SOURCE-DATE-EPOCH): Remove. (%standard-phases): Don't add it. * guix/build/gnu-build-system.scm (set-SOURCE-DATE-EPOCH): New procedure. (%standard-phases): Add it. (gnu-build): Remove 'setenv' call for "SOURCE_DATE_EPOCH".
Diffstat (limited to 'guix/build/gnu-build-system.scm')
-rw-r--r--guix/build/gnu-build-system.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index e168b6c7e9..2abaa6efdc 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -39,6 +39,13 @@
;;
;; Code:
+(define* (set-SOURCE-DATE-EPOCH #:rest _)
+ "Set the 'SOURCE_DATE_EPOCH' environment variable. This is used by tools
+that incorporate timestamps as a way to tell them to use a fixed timestamp.
+See https://reproducible-builds.org/specs/source-date-epoch/."
+ (setenv "SOURCE_DATE_EPOCH" "1")
+ #t)
+
(define (first-subdirectory dir)
"Return the path of the first sub-directory of DIR."
(file-system-fold (lambda (path stat result)
@@ -549,7 +556,7 @@ DOCUMENTATION-COMPRESSOR-FLAGS."
;; Standard build phases, as a list of symbol/procedure pairs.
(let-syntax ((phases (syntax-rules ()
((_ p ...) `((p . ,p) ...)))))
- (phases set-paths install-locale unpack
+ (phases set-SOURCE-DATE-EPOCH set-paths install-locale unpack
patch-usr-bin-file
patch-source-shebangs configure patch-generated-file-shebangs
build check install
@@ -577,9 +584,6 @@ in order. Return #t if all the PHASES succeeded, #f otherwise."
;; Encoding/decoding errors shouldn't be silent.
(fluid-set! %default-port-conversion-strategy 'error)
- ;; Avoid non-determinism related to generated timestamps.
- (setenv "SOURCE_DATE_EPOCH" "1")
-
;; The trick is to #:allow-other-keys everywhere, so that each procedure in
;; PHASES can pick the keyword arguments it's interested in.
(every (match-lambda