Source: py-lmdb
Version: 0.84-1
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi,

While working on the "reproducible builds" effort [1], we have noticed
that py-lmdb could not be built reproducibly.

The attached patch removes randomness from the build system by ensuring
_config.py is written in a deterministic order instead of based on the
the serialised dict order.

Once applied, py-lmdb can be built reproducibly in our reproducible
toolchain.

 [1]: https://wiki.debian.org/ReproducibleBuilds


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff --no-dereference -urNad py-lmdb.orig/py-lmdb-0.84/setup.py 
py-lmdb/py-lmdb-0.84/setup.py
--- py-lmdb.orig/py-lmdb-0.84/setup.py  2015-07-01 11:49:27.174695151 +0100
+++ py-lmdb/py-lmdb-0.84/setup.py       2015-07-01 11:54:36.832623968 +0100
@@ -110,13 +110,13 @@
 # errors). This happens even when `use_cpython` since user might want to
 # LMDB_FORCE_CFFI=1 during testing.
 with open('lmdb/_config.py', 'w') as fp:
-    fp.write('CONFIG = %r\n\n' % ({
-        'extra_compile_args': extra_compile_args,
-        'extra_sources': extra_sources,
-        'extra_library_dirs': extra_library_dirs,
-        'extra_include_dirs': extra_include_dirs,
-        'libraries': libraries
-    },))
+    fp.write('CONFIG = dict(%r)\n\n' % ((
+        ('extra_compile_args', extra_compile_args),
+        ('extra_sources', extra_sources),
+        ('extra_library_dirs', extra_library_dirs),
+        ('extra_include_dirs', extra_include_dirs),
+        ('libraries', libraries),
+    ),))
 
 
 if use_cpython:
_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to