guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/13: chromium-extension: Build .crx files in a deterministic fashion.


From: guix-commits
Subject: 07/13: chromium-extension: Build .crx files in a deterministic fashion.
Date: Thu, 16 Dec 2021 16:23:12 -0500 (EST)

mbakke pushed a commit to branch master
in repository guix.

commit aec6bd0169bb855a3ec70f5edec0701d0a66ce9d
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Thu Dec 16 19:06:35 2021 +0100

    chromium-extension: Build .crx files in a deterministic fashion.
    
    * gnu/build/chromium-extension.scm (make-crx): Pass #:keep-mtime? #t to
    COPY-RECURSIVELY.  Remove defunct FAKETIME workaround.  While at it, pack 
the
    extension in the scratch working directory instead of the transient
    store-mapped /tmp.
---
 gnu/build/chromium-extension.scm | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/gnu/build/chromium-extension.scm b/gnu/build/chromium-extension.scm
index 5bda8f8..656034b 100644
--- a/gnu/build/chromium-extension.scm
+++ b/gnu/build/chromium-extension.scm
@@ -19,8 +19,6 @@
 (define-module (gnu build chromium-extension)
   #:use-module (guix gexp)
   #:use-module (guix packages)
-  #:use-module (gnu packages base)
-  #:use-module (gnu packages check)
   #:use-module (gnu packages chromium)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages tls)
@@ -77,20 +75,17 @@ in PACKAGE-OUTPUT of PACKAGE.  The extension will be signed 
with SIGNING-KEY."
          (use-modules (guix build utils))
          (let ((chromium #$(file-append ungoogled-chromium "/bin/chromium"))
                (xvfb #$(file-append xorg-server "/bin/Xvfb"))
-               (packdir "/tmp/extension"))
-           (mkdir-p (dirname packdir))
-           (copy-recursively (ungexp package package-output) packdir)
+               (packdir (string-append (getcwd) "/extension")))
+           (mkdir packdir)
+           (copy-recursively (ungexp package package-output) packdir
+                             ;; Ensure consistent file modification times.
+                             #:keep-mtime? #t)
            (system (string-append xvfb " :1 &"))
            (setenv "DISPLAY" ":1")
            (sleep 2)                    ;give Xorg some time to initialize...
            ;; Chromium stores the current time in the .crx Zip archive.
            ;; Use a fixed timestamp for deterministic behavior.
-           ;; FIXME (core-updates): faketime is missing an absolute reference
-           ;; to 'date', hence the need to set PATH.
-           (setenv "PATH" #$(file-append coreutils "/bin"))
-           (invoke #$(file-append libfaketime "/bin/faketime")
-                   "2000-01-01 00:00:00"
-                   chromium
+           (invoke chromium
                    "--user-data-dir=/tmp/signing-profile"
                    (string-append "--pack-extension=" packdir)
                    (string-append "--pack-extension-key=" #$signing-key))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]