Bug#1058681: python-multipletau: please make the build reproducible
Chris Lamb
lamby at debian.org
Thu Dec 14 12:47:58 GMT 2023
Source: python-multipletau
Version: 0.3.3+ds-5
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
python-multipletau could not be built reproducibly.
This is because the code to work out its "own" version number uses
the current build date. (It does attempt to use the creation time of
the source files, but I think pybuild is essentially resetting this
to the current time by copying it to its temporary build directories.)
Patch attached that uses SOURCE_DATE_EPOCH if available.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/reproducible-build.patch 2023-12-14 12:33:24.343253202 +0000
@@ -0,0 +1,23 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2023-12-14
+
+--- python-multipletau-0.3.3+ds.orig/multipletau/_version.py
++++ python-multipletau-0.3.3+ds/multipletau/_version.py
+@@ -121,7 +121,15 @@ if True: # pragma: no cover
+ # Get the version from the previously generated `_version_save.py`
+ longversion = load_version(versionfile)
+
+- # 3. last resort: date
++ # 3. SOURCE_DATE_EPOCH
++ if longversion == "":
++ longversion = time.strftime(
++ "%Y.%m.%d-%H-%M-%S",
++ time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
++ )
++ print("Using SOURCE_DATE_EPOCH time as version: {}".format(longversion))
++
++ # 4. last resort: date
+ if longversion == "":
+ print("Could not determine version. Reason:")
+ print(traceback.format_exc())
--- a/debian/patches/series 2023-12-14 10:22:18.989780489 +0000
--- b/debian/patches/series 2023-12-14 12:33:23.379240195 +0000
@@ -1,3 +1,4 @@
examples_location.patch
packaged-mathjax.patch
python3.12.patch
+reproducible-build.patch
More information about the Reproducible-bugs
mailing list