Bug#1076806: meson-python: please make the build reproducible
Chris Lamb
lamby at debian.org
Tue Jul 23 14:37:05 BST 2024
Source: meson-python
Version: 0.16.0-1
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
meson-python could not be built reproducibly.
This is because the documentation embedded the current build date. A
patch is attached the seeds this value from SOURCE_DATE_EPOCH if
available in the 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 1970-01-01 01:00:00.000000000 +0100
--- b/debian/patches/Reproducible-build.patch 2024-07-23 14:33:34.520817409 +0100
@@ -0,0 +1,29 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2024-07-23
+
+--- meson-python-0.16.0.orig/docs/conf.py
++++ meson-python-0.16.0/docs/conf.py
+@@ -16,15 +16,21 @@
+
+ import datetime
+ import os
++import time
+ import sys
+ sys.path.insert(0, os.path.abspath('..'))
+ import mesonpy
+
++build_date = datetime.datetime.fromtimestamp(
++ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
++ tz=datetime.timezone.utc,
++)
++
+
+ # -- Project information -----------------------------------------------------
+
+ project = 'meson-python'
+-copyright = f'2021\N{EN DASH}{datetime.date.today().year} The meson-python developers'
++copyright = f'2021\N{EN DASH}{build_date.year} The meson-python developers'
+
+ # The short X.Y version
+ version = mesonpy.__version__
--- a/debian/patches/series 2024-07-23 13:55:11.648078974 +0100
--- b/debian/patches/series 2024-07-23 14:33:33.676802725 +0100
@@ -1 +1,2 @@
TST-adapt-to-changes-in-pyproject-metadata-0.8.0.patch
+Reproducible-build.patch
More information about the Reproducible-bugs
mailing list