Source: python-etcd3gw
Version: 0.2.1-2
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 python-etcd3gw could not be built reproducibly.

This is because one of the function signatures used a non-
deterministic / random default value that was rendered by the
documentation system at build time and thus varied each time.

Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
--- a/debian/patches/0001_reproducible-build.patch      1969-12-31 
16:00:00.000000000 -0800
--- b/debian/patches/0001_reproducible-build.patch      2019-08-16 
08:12:09.271187454 -0700
@@ -0,0 +1,23 @@
+Description: Make the build reproducible
+Author: Chris Lamb <la...@debian.org>
+Last-Update: 2019-08-16
+
+--- python-etcd3gw-0.2.1.orig/etcd3gw/client.py
++++ python-etcd3gw-0.2.1/etcd3gw/client.py
+@@ -115,13 +115,15 @@ class Etcd3Client(object):
+                            json={"TTL": ttl, "ID": 0})
+         return Lease(int(result['ID']), client=self)
+ 
+-    def lock(self, id=str(uuid.uuid4()), ttl=DEFAULT_TIMEOUT):
++    def lock(self, id=None, ttl=DEFAULT_TIMEOUT):
+         """Create a Lock object given an ID and timeout
+ 
+         :param id: ID for the lock, creates a new uuid if not provided
+         :param ttl: timeout
+         :return: Lock object
+         """
++        if id is None:
++            id = str(uuid.uuid4())
+         return Lock(id, ttl=ttl, client=self)
+ 
+     def create(self, key, value):
--- a/debian/patches/series     1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/series     2019-08-16 08:12:07.966645878 -0700
@@ -0,0 +1 @@
+0001_reproducible-build.patch

Reply via email to