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

Bug#1114772: rocm-docs-core: please make the build reproducible



Source: rocm-docs-core
Version: 1.23.0-3
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timezone
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed that
rocm-docs-core could not be built reproducibly.

This is because the documentation includes timestamps that vary on the
current build timezone. (The absolute timestamps are calculated from
the modification time of the file.)

Patch attached that prints these as UTC by changing a fromtimestamp to
a utcfromtimestamp.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/0007-Reproducible-build.patch	1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/0007-Reproducible-build.patch	2025-09-09 11:00:49.134077523 -0700
@@ -0,0 +1,25 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby@debian.org>
+Last-Update: 2025-09-09
+
+--- rocm-docs-core-1.23.0.orig/src/rocm_docs/article_info.py
++++ rocm-docs-core-1.23.0/src/rocm_docs/article_info.py
+@@ -158,7 +158,7 @@ def _set_all_article_info(
+ 
+         if "ROCM_DOCS_NO_GIT" in os.environ:
+             logger.debug("Disabling GIT query for date, use timestamp : %s", Path(app.srcdir, page_rel))
+-            date_info = datetime.datetime.fromtimestamp(os.path.getmtime(Path(app.srcdir, page_rel))).strftime("%Y-%m-%d")
++            date_info = datetime.datetime.utcfromtimestamp(os.path.getmtime(Path(app.srcdir, page_rel))).strftime("%Y-%m-%d")
+         else:
+             date_info = _get_time_last_modified(repo, Path(app.srcdir, page_rel))
+ 
+--- rocm-docs-core-1.23.0.orig/docs/conf.py
++++ rocm-docs-core-1.23.0/docs/conf.py
+@@ -35,6 +35,7 @@ article_pages = [
+     },
+     {
+         "file": "developer_guide/commitizen",
++        "date": "",
+     },
+ ]
+ 
--- a/debian/patches/series	2025-09-09 10:47:27.910466834 -0700
--- b/debian/patches/series	2025-09-09 10:56:51.150456499 -0700
@@ -2,3 +2,4 @@
 0003-Don-t-fail-if-not-in-git-repo.patch
 0006-Fix-linking-toc.patch
 0004-Merge-Get-data-from-env-and-Add-option-to-skip-theme.patch
+0007-Reproducible-build.patch

Reply to: