unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
blob b36a770cc6d31b83194deb67ad1654e367264a6e 1642 bytes (raw)
name: gnu/packages/patches/icecat-reproducible-langpacks.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
Prevent the extension manifests from embedding the current date.

This is inspired by the Debian
"Use-build-id-as-langpack-version-for-reproducibility.patch" maintained for
their Firefox package as well as reproducible-builds.org guidelines from
https://reproducible-builds.org/docs/source-date-epoch/.

Upstream status: https://phabricator.services.mozilla.com/D169979

--- ./python/mozbuild/mozbuild/action/langpack_manifest.py.old	2023-02-13 11:01:21.051537347 -0500
+++ ./python/mozbuild/mozbuild/action/langpack_manifest.py	2023-02-13 11:04:33.141817330 -0500
@@ -36,6 +36,15 @@
 pushlog_api_url = "{0}/json-rev/{1}"
 
 
+import os
+import time
+import datetime
+
+def get_build_date():
+    """Honor SOURCE_DATE_EPOCH for reproducibility."""
+    return datetime.datetime.utcfromtimestamp(
+        int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
+
 ###
 # Retrievers a UTC datetime of the push for the current commit
 # from a mercurial clone directory.
@@ -54,7 +63,7 @@
     with mozversioncontrol.get_repository_object(path=path) as repo:
         phase = repo._run("log", "-r", ".", "-T" "{phase}")
         if phase.strip() != "public":
-            return datetime.datetime.utcnow()
+            return get_build_date()
         repo_url = repo._run("paths", "default")
         repo_url = repo_url.strip().replace("ssh://", "https://")
         repo_url = repo_url.replace("hg://", "https://")
@@ -105,7 +114,7 @@
         dt = get_dt_from_hg(path)
 
     if dt is None:
-        dt = datetime.datetime.utcnow()
+        dt = get_build_date()
 
     dt = dt.replace(microsecond=0)
     return dt.strftime("%Y%m%d%H%M%S")

debug log:

solving b36a770cc6 ...
found b36a770cc6 in https://yhetil.org/guix-bugs/20230216043649.32119-4-maxim.cournoyer@gmail.com/ ||
	https://yhetil.org/guix-bugs/20230217125539.24467-4-maxim.cournoyer@gmail.com/

applying [1/1] https://yhetil.org/guix-bugs/20230216043649.32119-4-maxim.cournoyer@gmail.com/
diff --git a/gnu/packages/patches/icecat-reproducible-langpacks.patch b/gnu/packages/patches/icecat-reproducible-langpacks.patch
new file mode 100644
index 0000000000..b36a770cc6

1:20: trailing whitespace.
 
1:21: trailing whitespace.
 
1:45: trailing whitespace.
 
1:49: trailing whitespace.
 
Checking patch gnu/packages/patches/icecat-reproducible-langpacks.patch...
Applied patch gnu/packages/patches/icecat-reproducible-langpacks.patch cleanly.
warning: 4 lines add whitespace errors.

skipping https://yhetil.org/guix-bugs/20230217125539.24467-4-maxim.cournoyer@gmail.com/ for b36a770cc6
index at:
100644 b36a770cc6d31b83194deb67ad1654e367264a6e	gnu/packages/patches/icecat-reproducible-langpacks.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).