Debian Bug report logs - #995131
nut: reproducible builds: udev rules vary depending readdir order

version graph

Package: src:nut; Maintainer for src:nut is Laurent Bigonville <bigon@debian.org>;

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Sun, 26 Sep 2021 20:00:01 UTC

Severity: normal

Tags: fixed-upstream, patch

Fixed in version nut/2.8.0-1

Done: Laurent Bigonville <bigon@debian.org>

Bug is archived. No further changes may be made.

Forwarded to https://github.com/networkupstools/nut/pull/528

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Laurent Bigonville <bigon@debian.org>:
Bug#995131; Package src:nut. (Sun, 26 Sep 2021 20:00:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Laurent Bigonville <bigon@debian.org>. (Sun, 26 Sep 2021 20:00:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: submit@bugs.debian.org
Subject: nut: reproducible builds: udev rules vary depending readdir order
Date: Sun, 26 Sep 2021 12:57:19 -0700
[Message part 1 (text/plain, inline)]
Source: nut
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

The comments for various udev rules list different drivers for some
devices.

  https://tests.reproducible-builds.org/debian/rb-pkg/unstable/i386/diffoscope-results/nut.html

  /lib/udev/rules.d/62-nut-usbups.rules

  Krauler·UP-M500VA··-·blazer_usb
  vs.
  Krauler·UP-M500VA··-·nutdrv_qx

The udev rules are generated from tools/nut-usbinfo.pl reading the files
in ../drivers/, using perl's File::Find, which does not reliably return
the same file ordering. In some cases, multiple drivers claim support
for a given device, and which driver gets embedded into the udev
comments depends on the order in which the directory contents were
returned.

The attached patch fixes this by sorting the directory output.

With this patch applied, nut should become reproducible on
tests.reproducible-builds.org.

Our test infrastructure seems to only reliably catch this issue on i386
and armhf (e.g. 32-bit architectures).


Thanks for maintaining nut!


live well,
  vagrant
[0001-nut-usbinfo.pl-Sort-the-directory-scan-results.patch (text/x-diff, inline)]
From c18bf3799a6b8dafcfe42c1a0e595ae54b7d3f82 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sun, 26 Sep 2021 19:21:00 +0000
Subject: [PATCH] nut-usbinfo.pl: Sort the directory scan results.

The order of the files processed depends on readdir order. As some
devices are supported by multiple drivers, which one gets embedded in
the output (e.g. udev rules) depends on the order of the processed
files.

https://reproducible-builds.org/docs/stable-inputs/
---
 tools/nut-usbinfo.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl
index 2c0dd05..56dd331 100755
--- a/tools/nut-usbinfo.pl
+++ b/tools/nut-usbinfo.pl
@@ -76,7 +76,9 @@ my %vendorName;
 
 ################# MAIN #################
 
-find(\&find_usbdevs,$scanPath);
+find({wanted => \&find_usbdevs,
+      preprocess => sub { sort(@_)}}
+     ,$scanPath);
 &gen_usb_files;
 
 ################# SUB METHOD #################
-- 
2.33.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Laurent Bigonville <bigon@debian.org>:
Bug#995131; Package src:nut. (Sun, 26 Sep 2021 20:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
Extra info received and forwarded to list. Copy sent to Laurent Bigonville <bigon@debian.org>. (Sun, 26 Sep 2021 20:15:03 GMT) (full text, mbox, link).


Message #10 received at 995131@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: 995131@bugs.debian.org
Subject: Re: nut: reproducible builds: udev rules vary depending readdir order
Date: Sun, 26 Sep 2021 13:13:11 -0700
[Message part 1 (text/plain, inline)]
Control: forwarded 995131 https://github.com/networkupstools/nut/pull/528
Control: tags 995131 fixed-upstream

Already reported and fixed upstream:

  https://github.com/networkupstools/nut/commit/d693c427c526af1a933fa9aa95165c483fe08114

The patch is basically the same.

No new upstream release has been made in the years since... there does
seem to be some recent activity in git.


live well,
  vagrant

On 2021-09-26, Vagrant Cascadian wrote:
> The comments for various udev rules list different drivers for some
> devices.
>
>   https://tests.reproducible-builds.org/debian/rb-pkg/unstable/i386/diffoscope-results/nut.html
>
>   /lib/udev/rules.d/62-nut-usbups.rules
>
>   Krauler·UP-M500VA··-·blazer_usb
>   vs.
>   Krauler·UP-M500VA··-·nutdrv_qx
>
> The udev rules are generated from tools/nut-usbinfo.pl reading the files
> in ../drivers/, using perl's File::Find, which does not reliably return
> the same file ordering. In some cases, multiple drivers claim support
> for a given device, and which driver gets embedded into the udev
> comments depends on the order in which the directory contents were
> returned.
>
> The attached patch fixes this by sorting the directory output.
>
> With this patch applied, nut should become reproducible on
> tests.reproducible-builds.org.
>
> Our test infrastructure seems to only reliably catch this issue on i386
> and armhf (e.g. 32-bit architectures).
>
>
> Thanks for maintaining nut!
>
>
> live well,
>   vagrant
> From c18bf3799a6b8dafcfe42c1a0e595ae54b7d3f82 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant@reproducible-builds.org>
> Date: Sun, 26 Sep 2021 19:21:00 +0000
> Subject: [PATCH] nut-usbinfo.pl: Sort the directory scan results.
>
> The order of the files processed depends on readdir order. As some
> devices are supported by multiple drivers, which one gets embedded in
> the output (e.g. udev rules) depends on the order of the processed
> files.
>
> https://reproducible-builds.org/docs/stable-inputs/
> ---
>  tools/nut-usbinfo.pl | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl
> index 2c0dd05..56dd331 100755
> --- a/tools/nut-usbinfo.pl
> +++ b/tools/nut-usbinfo.pl
> @@ -76,7 +76,9 @@ my %vendorName;
>  
>  ################# MAIN #################
>  
> -find(\&find_usbdevs,$scanPath);
> +find({wanted => \&find_usbdevs,
> +      preprocess => sub { sort(@_)}}
> +     ,$scanPath);
>  &gen_usb_files;
>  
>  ################# SUB METHOD #################
> -- 
> 2.33.0
[signature.asc (application/pgp-signature, inline)]

Set Bug forwarded-to-address to 'https://github.com/networkupstools/nut/pull/528'. Request was from Vagrant Cascadian <vagrant@reproducible-builds.org> to 995131-submit@bugs.debian.org. (Sun, 26 Sep 2021 20:15:03 GMT) (full text, mbox, link).


Added tag(s) fixed-upstream. Request was from Vagrant Cascadian <vagrant@reproducible-builds.org> to 995131-submit@bugs.debian.org. (Sun, 26 Sep 2021 20:15:04 GMT) (full text, mbox, link).


Marked as fixed in versions nut/2.8.0-1. Request was from Laurent Bigonville <bigon@debian.org> to control@bugs.debian.org. (Tue, 27 Sep 2022 10:21:04 GMT) (full text, mbox, link).


Marked Bug as done Request was from Laurent Bigonville <bigon@debian.org> to control@bugs.debian.org. (Tue, 27 Sep 2022 10:21:05 GMT) (full text, mbox, link).


Notification sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
Bug acknowledged by developer. (Tue, 27 Sep 2022 10:21:05 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 26 Oct 2022 07:25:20 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed May 17 12:13:03 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.