build: asdf-build-system: Improve reproducibility.
authorGuillaume Le Vaillant <glv@posteo.net>
Sun, 12 Jan 2020 13:29:41 +0000 (14:29 +0100)
committerGuillaume Le Vaillant <glv@posteo.net>
Sun, 12 Jan 2020 13:48:30 +0000 (14:48 +0100)
* guix/build/asdf-build-system.scm (copy-files-to-output): Reset timestamps of
  source files before compiling.

guix/build/asdf-build-system.scm

index 1be2b3c..f3f4b49 100644 (file)
@@ -79,6 +79,15 @@ valid."
   (let ((source (getcwd))
         (target (source-directory out name))
         (system-path (string-append out %system-install-prefix)))
+    ;; SBCL keeps the modification time of the source file in the compiled
+    ;; file, and the source files might just have been patched by a custom
+    ;; phase. Therefore we reset the modification time of all the source
+    ;; files before compiling.
+    (for-each (lambda (file)
+                (let ((s (lstat file)))
+                  (unless (eq? (stat:type s) 'symlink)
+                    (utime file 0 0 0 0))))
+              (find-files source #:directories? #t))
     (copy-recursively source target #:keep-mtime? #t)
     (mkdir-p system-path)
     (for-each