Source: pytsk
Version: 20200117-3
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

Hi,

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

This is because it generated a pytsk3.c file in a nondeterministic
manner, specifically by naively iterating over a Python set()
structure.

Patch attached.

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


Regards,

--
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/0002-Reproducible-build.patch      1970-01-01 
01:00:00.000000000 +0100
--- b/debian/patches/0002-Reproducible-build.patch      2021-08-10 
11:33:28.947652513 +0100
@@ -0,0 +1,15 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2021-08-10
+
+--- pytsk-20200117.orig/class_parser.py
++++ pytsk-20200117/class_parser.py
+@@ -914,7 +914,7 @@ uint64_t integer_object_copy_to_uint64(P
+             self.initialise_class(class_name, out, done)
+ 
+         # Add the constants in here
+-        for constant, type in self.constants:
++        for constant, type in sorted(self.constants):
+             if type == "integer":
+                 out.write(
+                     "    tmp = PyLong_FromUnsignedLongLong((uint64_t) 
{0:s});\n".format(constant))
--- a/debian/patches/series     2021-08-10 11:29:42.852085888 +0100
--- b/debian/patches/series     2021-08-10 11:33:28.139656520 +0100
@@ -1,2 +1,3 @@
 0001-Link-system-tsk-statically-talloc-dynamically-instea.patch
 change-lexer.patch
+0002-Reproducible-build.patch

Reply via email to