On 2024-04-11, Chris Lamb wrote:
> Whilst working on the Reproducible Builds effort [0], we noticed that
> pympress could not be built reproducibly.
>
> This is because the generated documentation included memory references
> such as the following:
>
>   pointer = <GdkPixbuf.Pixbuf object at 0x7f2d6ee3e700 (GdkPixbuf at 
> 0x1d4cf90)>
>
> A patch attached that uses Python's "default = None […] if default is
> None: default = realdefault" pattern.

I found two more issues:

The documentation is afffected by LANGUAGE and LC_ALL environment
variables.

The kernel version is embeded in the documentation.

With the two additional patches applied and the original patch submitted
by Chris, I think pympress should build reproducibly!

live well,
  vagrant
From 9d0ea933d092b674903ce1b9c2e95e35753b7274 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@debian.org>
Date: Fri, 24 Jan 2025 14:43:00 -0800
Subject: [PATCH 1/2] debian/rules: Force locale for documentation generation.

---
 debian/rules | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/rules b/debian/rules
index 08aef4f..c804539 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,6 +6,9 @@ export PYBUILD_DESTDIR_python3 = debian/pympress/
 # Needed by sphinx build
 export HOME=$(CURDIR)/debian/fakehome/
 
+export LANGUAGE=en
+export LC_ALL=C.UTF-8
+
 %:
 	dh $@ --with sphinxdoc --buildsystem=pybuild
 
-- 
2.39.5

From 21f3b58bc8849b160bf139ba62804a1b81668065 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@debian.org>
Date: Fri, 24 Jan 2025 14:53:44 -0800
Subject: [PATCH 2/2] pympress/app.py: Redact platform.release and
 platform.version for reproducible builds.

---
 pympress/app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pympress/app.py b/pympress/app.py
index 70dd42c..9d9b882 100644
--- a/pympress/app.py
+++ b/pympress/app.py
@@ -91,7 +91,7 @@ class Pympress(Gtk.Application):
     version_string = ' '.join([
         'Pympress:', util.get_pympress_meta()['version'],
         '; Python:', platform.python_version(),
-        '; OS:', platform.system(), platform.release(), platform.version(),
+        '; OS:', platform.system(), 'REDACTED', 'REDACTED',
         '; Gtk {}.{}.{}'.format(Gtk.get_major_version(), Gtk.get_minor_version(), Gtk.get_micro_version()),
         '; GLib {}.{}.{}'.format(GLib.MAJOR_VERSION, GLib.MINOR_VERSION, GLib.MICRO_VERSION),
         '; Poppler', document.Poppler.get_version(), document.Poppler.get_backend().value_nick,
-- 
2.39.5

Attachment: signature.asc
Description: PGP signature

Reply via email to