Bug#1064892: klepto: please make the build reproducible

Chris Lamb lamby at debian.org
Tue Feb 27 10:50:49 GMT 2024


Source: klepto
Version: 0.2.5-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

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

This is because one of its functions docstrings was generated
programatically in a nondeterminstic manner:

│ │ │ │ │        cryptographic hashing
│ │ │ │ │ -      algorithm: one of (None, ‘shake_256’, ‘md5’, ‘md5-sha1’, ‘sha512’,
│ │ │ │ │ -      ‘sha1’, ‘sha256’, ‘blake2b’, ‘sha3_224’, ‘sm3’, ‘sha384’, ‘sha3_256’,
│ │ │ │ │ -      ‘sha224’, ‘sha3_512’, ‘sha3_384’, ‘sha512_224’, ‘blake2s’, ‘shake_128’,
│ │ │ │ │ -      ‘sha512_256’, ‘ripemd160’) The default is algorithm=None, which uses
│ │ │ │ │ -      python’s ‘hash’.
│ │ │ │ │ +      algorithm: one of (None, ‘sm3’, ‘sha512_256’, ‘blake2b’, ‘shake_256’,
│ │ │ │ │ +      ‘sha512’, ‘sha3_224’, ‘blake2s’, ‘sha384’, ‘sha1’, ‘shake_128’, ‘sha256’,
│ │ │ │ │ +      ‘sha3_256’, ‘sha3_512’, ‘md5-sha1’, ‘sha224’, ‘sha512_224’, ‘sha3_384’,
│ │ │ │ │ +      ‘md5’, ‘ripemd160’) The default is algorithm=None, which uses python’s
│ │ │ │ │ +      ‘hash’.kkkkkkkkkhhhk

Patch attached.


 [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-02-27 10:46:36.696040794 +0000
@@ -0,0 +1,15 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2024-02-27
+
+--- klepto-0.2.5.orig/klepto/crypto.py
++++ klepto-0.2.5/klepto/crypto.py
+@@ -19,7 +19,7 @@ def algorithms():
+         algs =  tuple(hashlib.algorithms_available)
+     except:
+         algs = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
+-    return (None,) + algs
++    return (None,) + tuple(sorted(algs))
+ 
+ def hash(object, algorithm=None):
+     if algorithm is None:
--- a/debian/patches/series	2024-02-27 10:39:57.359562009 +0000
--- b/debian/patches/series	2024-02-27 10:46:35.712044814 +0000
@@ -1,2 +1,3 @@
 privacy-protection.patch
 skip-mysql-test.patch
+reproducible-build.patch


More information about the Reproducible-bugs mailing list