Bug#1022777: tpm2-pytss: please make the build reproducible
Chris Lamb
lamby at debian.org
Tue Oct 25 18:39:05 BST 2022
Source: tpm2-pytss
Version: 1.2.0-2
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org
Hi,
Whilst working on the Reproducible Builds effort [0] we noticed that
tpm2-pytss could not be built reproducibly.
This is because it embedded the current "build" year by calling out
to datetime.datetime.utcnow() when building the documentation.
Patch attached that seeds this value from SOURCE_DATE_EPOCH if it
exists in the surrounding environment.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch 1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/reproducible-build.patch 2022-10-25 10:32:58.818873778 -0700
@@ -0,0 +1,26 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2022-10-25
+
+--- tpm2-pytss-1.2.0.orig/docs/conf.py
++++ tpm2-pytss-1.2.0/docs/conf.py
+@@ -12,6 +12,7 @@
+ #
+ import os
+ import sys
++import time
+ import datetime
+ import subprocess
+
+@@ -57,7 +58,10 @@ import tpm2_pytss
+
+ project = "tpm2-pytss"
+ author = "tpm2-software"
+-copyright = f"2019 - {datetime.datetime.today().year}, {author}"
++build_date = datetime.datetime.utcfromtimestamp(
++ int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
++)
++copyright = f"2019 - {build_date.year}, {author}"
+
+ # The short X.Y version
+ version = get_version(root="..", relative_to=__file__)
--- a/debian/patches/series 2022-10-25 10:25:20.122542133 -0700
--- b/debian/patches/series 2022-10-25 10:32:57.862874412 -0700
@@ -1 +1,2 @@
debian-hacks/docs-Use-internal-ressources-for-intersphinx.patch
+reproducible-build.patch
More information about the Reproducible-bugs
mailing list