Bug#1068377: python-oslo.messaging: please make the build reproducible

Chris Lamb lamby at debian.org
Thu Apr 4 10:39:11 BST 2024


Source: python-oslo.messaging
Version: 14.7.0-2
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: hostname
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

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

This is because the documentation captures the hostname of the build
system. Specifically:

├── ./usr/share/doc/python3-oslo.messaging/html/configuration/opts.htm
│ │          Type:
│ │              string
│ │          Default:
| │ -            ionos11-amd64
│ │ │ │ │ +            i-capture-the-hostname
│ │        Hostname used by queue manager


Patch attached that uses the Python "blah = None" / "if blah is None"
pattern so that the Python default is the value "None" whilst the
underlying functionality remains the same — ie. defaulting to
socket.gethostname().

 [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-04-04 10:31:01.530250426 +0100
@@ -0,0 +1,35 @@
+Description: Make the build reproducible
+Author: Chris Lamb <lamby at debian.org>
+Last-Update: 2024-04-04
+
+--- python-oslo.messaging-14.7.0.orig/oslo_messaging/_drivers/impl_rabbit.py
++++ python-oslo.messaging-14.7.0/oslo_messaging/_drivers/impl_rabbit.py
+@@ -246,7 +246,7 @@ rabbit_opts = [
+                 default=False,
+                 help='Should we use consistant queue names or random ones'),
+     cfg.StrOpt('hostname',
+-               default=socket.gethostname(),
++               default=None,
+                help='Hostname used by queue manager'),
+     cfg.StrOpt('processname',
+                default=os.path.basename(sys.argv[0]),
+@@ -697,6 +697,10 @@ class Connection(object):
+         self.enable_cancel_on_failover = driver_conf.enable_cancel_on_failover
+         self.use_queue_manager = driver_conf.use_queue_manager
+ 
++        self.hostname = driver_conf.hostname
++        if self.hostname is None:
++            self.hostname = socket.gethostname()
++
+         if self.rabbit_stream_fanout and self.rabbit_qos_prefetch_count <= 0:
+             raise RuntimeError('Configuration Error: rabbit_stream_fanout '
+                                'need rabbit_qos_prefetch_count to be set to '
+@@ -888,7 +892,7 @@ class Connection(object):
+ 
+         if self.use_queue_manager:
+             self._q_manager = amqpdriver.QManager(
+-                hostname=driver_conf.hostname,
++                hostname=self.hostname,
+                 processname=driver_conf.processname)
+         else:
+             self._q_manager = None
--- a/debian/patches/series	2024-04-04 10:18:59.452475473 +0100
--- b/debian/patches/series	2024-04-04 10:31:00.538244802 +0100
@@ -1 +1,2 @@
 no-functional-test.patch
+reproducible-build.patch


More information about the Reproducible-bugs mailing list