Bug#1085280: pywayland: please make the build reproducible

Chris Lamb lamby at debian.org
Thu Oct 17 15:50:03 BST 2024


Source: pywayland
Version: 0.4.18-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: filesystem
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

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

This is because the documentation is generated by iterating over the
filesystem in a naive/nondeterministic order.

A patch is attached that makes this deterministic.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/patches/02_reproducible_build.diff	1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/02_reproducible_build.diff	2024-10-17 07:48:20.475787026 -0700
@@ -0,0 +1,24 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2024-10-17
+
+--- pywayland-0.4.18.orig/doc/conf.py
++++ pywayland-0.4.18/doc/conf.py
+@@ -90,7 +90,7 @@ def protocol_doc(input_dir, output_dir):
+         with open(index_file, "w") as f:
+             f.write(generated_index)
+ 
+-    for module in modules:
++    for module in sorted(modules):
+         output = [protocol_header.format(module=module, len=len(module), empty="")]
+ 
+         # get all the python files that we want to document
+@@ -102,7 +102,7 @@ def protocol_doc(input_dir, output_dir):
+         ]
+ 
+         # build the rst for each protocol
+-        for doc_file in doc_files:
++        for doc_file in sorted(doc_files):
+             mod = importlib.import_module(f"pywayland.protocol.{module}.{doc_file}")
+             # Get out the name of the class in the module
+             class_name = "".join(x.capitalize() for x in doc_file.split("_"))
--- a/debian/patches/series	2024-10-17 07:37:27.608267784 -0700
--- b/debian/patches/series	2024-10-17 07:42:13.655791286 -0700
@@ -1 +1,2 @@
 01_force_upstream_version.diff
+02_reproducible_build.diff
--- a/doc/conf.py	2024-10-17 07:37:27.608267784 -0700
--- b/doc/conf.py	2024-10-17 07:48:19.403786402 -0700
@@ -90,7 +90,7 @@
         with open(index_file, "w") as f:
             f.write(generated_index)
 
-    for module in modules:
+    for module in sorted(modules):
         output = [protocol_header.format(module=module, len=len(module), empty="")]
 
         # get all the python files that we want to document
@@ -102,7 +102,7 @@
         ]
 
         # build the rst for each protocol
-        for doc_file in doc_files:
+        for doc_file in sorted(doc_files):
             mod = importlib.import_module(f"pywayland.protocol.{module}.{doc_file}")
             # Get out the name of the class in the module
             class_name = "".join(x.capitalize() for x in doc_file.split("_"))


More information about the Reproducible-bugs mailing list