Bug#908072: diffoscope: `bin/diffoscope --list-debian-substvars` output depends on installed packages

2018-09-10 Thread Chris Lamb
tags 908072 + pending
thanks

Fixed in Git, pending upload:

  
https://salsa.debian.org/reproducible-builds/diffoscope/commit/889e4bf7394d465ae2c9a17a0661bb401c30f54a

  diffoscope/main.py | 15 ---
  1 file changed, 12 insertions(+), 3 deletions(-)

I didn't go with the:

- import rpm
+ try:
+import rpm
+ except ImportError:
+tool_required.all.add('rpm2cpio') # lol hack
+ raise

… solution as, for example, we were not importing changes.py (and thus
calling @tool_required('gpg')) but this was only due to not importing
the enhanced Debian comparator in debian.py so this would have been
somewhat too distant of an action.

This solution also allows for a big stonkin' comment regarding this
ugliness.


Regards,

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



Bug#908072: diffoscope: `bin/diffoscope --list-debian-substvars` output depends on installed packages

2018-09-06 Thread Chris Lamb
Hi Mattia,

> In particular, it seems "gnupg" and "rpm2cpio" are not printed if they
> are not installed.

This is due to:

 * The @tool_required decorator adds all tool names that were passed to
   it to a global variable at module import time (NB. not execution
   time; decorators are executed at import time)

 * Our substvar generation then loops over this global variable.

 * Therefore if a module is is never fully imported then the  
   @tool_required will not be encountered.

The following is from diffoscope/comparators/rpm.py. As the "import
rpm" will fail if python3-rpm is not installed, the @tool_required will
not be imported.

  […]

  import rpm

  […]

  class RpmContainer(Archive):
  @tool_required('rpm2cpio')
  def extract(self, member_name, dest_dir):
  […]

Ideas? Hard-code the additions of gnupg or rpm2cpio in
ListDebianSubstvarsAction? Perhaps it would be cleaner to add some
explicit call in the RPM comparator, for example:

- import rpm
+ try:
+import rpm
+ except ImportError:
+tool_required.all.add('rpm2cpio') # lol hack
+ raise

… but this is not terribly nice in itself.


Regards,

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



Bug#908072: diffoscope: `bin/diffoscope --list-debian-substvars` output depends on installed packages

2018-09-05 Thread Mattia Rizzolo
Package: diffoscope
Version: 99
Severity: important

`bin/diffoscope --list-debian-substvars` depends on installed packages.

In particular, it seems "gnupg" and "rpm2cpio" are not printed if they
are not installed.
This makes d/rules generate differing d/tests/control whether the
package is built with nocheck or not.

This accidentally caused the FTBFS of version 100 (about to be
reported).

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature