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

2024-04-09 Thread Chris Lamb
Thomas Goirand wrote:

> However, a better patch would be to use the sample_default= directive of 
> oslo.config, which is printing in the generated doc, whatever the value 
> of sample_default, while continuing to keep the default= value that can 
> contain something programmatic. This avoids writing the "if blah is 
> None" as you've put it.

Ah — now I remember this was introduced a while back for precisely
this reason. Many thanks. :)


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org  chris-lamb.co.uk
   `-



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

2024-04-09 Thread Thomas Goirand

Hi Chris,

Thanks for your patch.

However, a better patch would be to use the sample_default= directive of 
oslo.config, which is printing in the generated doc, whatever the value 
of sample_default, while continuing to keep the default= value that can 
contain something programmatic. This avoids writing the "if blah is 
None" as you've put it.


I've sent this upstream and patched olso.messaging accordingly.

Cheers,

Thomas Goirand (zigo)



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

2024-04-09 Thread Chris Lamb
affects 1068377 + zaqar
thanks

Chris Lamb wrote:

> > Whilst working on the Reproducible Builds effort [0], we noticed that
> > python-oslo.messaging could not be built reproducibly.
>
> The underlying bit of code is actually also causing src:magnum to be
> unreproducible as well.

And zaqar. :)


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org  chris-lamb.co.uk
   `-



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

2024-04-08 Thread Chris Lamb
affects 1068377 + magnum
thanks

Chris Lamb wrote:

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

The underlying bit of code is actually also causing src:magnum to be
unreproducible as well.


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org  chris-lamb.co.uk
   `-



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

2024-04-04 Thread Chris Lamb
Source: python-oslo.messaging
Version: 14.7.0-2
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: hostname
X-Debbugs-Cc: reproducible-b...@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
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-


--- a/debian/patches/reproducible-build.patch   1970-01-01 01:00:00.0 
+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 
+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