Bug#870221: dpkg: please sort the "unused substitution" warnings

Chris Lamb lamby at debian.org
Mon Jul 31 02:19:52 UTC 2017


Source: dpkg
Version: 1.18.24
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: hashordering toolchain
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed
that dpkg emits "unused substitution" warnings in a non-deterministic
Perl hash order.

Correcting this would be helpful for the Reproducible Builds effort
as it removes differences between in log between package builds.

Whilst the build log is not part of the defined reproducible build
output (!) we use the diff of two build logs as a useful debugging aid
when working out why a package is not reproducible, and reducing any
noise makes this easier.

  --- a/scripts/Dpkg/Substvars.pm
  +++ b/scripts/Dpkg/Substvars.pm
  @@ -342,7 +342,7 @@ sub warn_about_unused {
       my ($self, %opts) = @_;
       $opts{msg_prefix} //= $self->{msg_prefix};
 
  -    foreach my $vn (keys %{$self->{vars}}) {
  +    foreach my $vn (sort keys %{$self->{vars}}) {
           next if $self->{attr}{$vn} & SUBSTVAR_ATTR_USED;
           # Empty substitutions variables are ignored on the basis
           # that they are not required in the current situation


Patch attached.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-


More information about the Reproducible-bugs mailing list