Skip Menu |

This queue is for tickets about the ExtUtils-Depends CPAN distribution.

Report information
The Basics
Id: 101602
Status: resolved
Priority: 0/
Queue: ExtUtils-Depends

People
Owner: XAOC [...] cpan.org
Requestors: reiner [...] reiner-h.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: save_config produces different output on repeated invocation
Date: Sun, 18 Jan 2015 16:03:36 +0100
To: bug-ExtUtils-Depends [...] rt.cpan.org
From: Reiner Herrmann <reiner [...] reiner-h.de>
Hi! While working on Debian's “reproducible builds” effort [1], we have noticed that some packages which are using ExtUtils::Depends contain differing files after each build. The save_config method does not sort the dependency list and so the output varies. The attached patch fixes this by sorting the keys. Regards, Reiner [1]: https://wiki.debian.org/ReproducibleBuilds

Message body is not shown because sender requested not to inline it.

Download signature.asc
application/pgp-signature 181b

Message body not shown because it is not plain text.

CC: reiner [...] reiner-h.de
Subject: [rt.cpan.org #101602] Reproducibility amendment
Date: Wed, 21 Jan 2015 21:13:04 +0100
To: bug-ExtUtils-Depends [...] rt.cpan.org
From: Maria Marin <marivalenm [...] gmail.com>
Hi, we discovered an additional issue concerning reproducibility in ExtUtils::Depends. The attached patch includes the hunk of Reiner's patch plus an additional one which solves the problem with linker arguments of random order in packages like xacobeo. Thanks, akira

Message body is not shown because sender requested not to inline it.

On Wed Jan 21 15:13:21 2015, marivalenm@gmail.com wrote: Show quoted text
> Hi, > > we discovered an additional issue concerning reproducibility in > ExtUtils::Depends. > The attached patch includes the hunk of Reiner's patch plus an > additional one which solves the problem with linker arguments of > random order in packages like xacobeo.
Torsten, do you see any problems with sorting dependencies in save_config() and get_makefile_vars()?
Subject: Re: [rt.cpan.org #101602] save_config produces different output on repeated invocation
Date: Mon, 26 Jan 2015 16:22:07 +0100
To: bug-ExtUtils-Depends [...] rt.cpan.org
From: "Torsten Schönfeld" <kaffeetisch [...] gmx.de>
"Brian Manning via RT" <bug-ExtUtils-Depends@rt.cpan.org>: Show quoted text
> Torsten, do you see any problems with sorting dependencies in save_config() and get_makefile_vars()?
The get_makefile_vars() change looks good to me. But isn't the save_config() change unnecessary given the commit <https://git.gnome.org/browse/perl-ExtUtils-Depends/commit/?id=64b194cfbc650f727278ce3c6e73b14904a4d219>?
On Mon Jan 26 10:22:22 2015, TSCH wrote: Show quoted text
> "Brian Manning via RT" <bug-ExtUtils-Depends@rt.cpan.org>:
> > Torsten, do you see any problems with sorting dependencies in > > save_config() and get_makefile_vars()?
> > The get_makefile_vars() change looks good to me. But isn't the > save_config() change unnecessary given the commit > <https://git.gnome.org/browse/perl-ExtUtils- > Depends/commit/?id=64b194cfbc650f727278ce3c6e73b14904a4d219>?
$Data::Dumper::Sortkeys = 1 only sorts the keys inside of hashes that are being dumped; $self->{deps} is an array of module names. Attached demo script and script output files (sorted, and unsorted) shows the output of ExtUtils::Depends->save_config(), without the patch posted earlier, you can see inside the $self hash reference that the keys are sorted, but in the deps[] array, the values of the array are not sorted.
Subject: extutils-depends-save_config-demo.pl
#!/usr/bin/env perl # script to demo ExtUtils::Depends->save_config use strict; use warnings; use 5.010; use ExtUtils::Depends; my $deps = ExtUtils::Depends->new(q(Foo), q(Gtk2)); $deps->save_config(q(extutils-depends.tmp));
Subject: extutils-depends.save_config.sorted.txt
package Foo::Install::Files; $self = { 'deps' => [ 'Cairo', 'Glib', 'Gtk2', 'Pango' ], 'inc' => '', 'libs' => '', 'typemaps' => [] }; @deps = @{ $self->{deps} }; @typemaps = @{ $self->{typemaps} }; $libs = $self->{libs}; $inc = $self->{inc}; $CORE = undef; foreach (@INC) { if ( -f $_ . "/Foo/Install/Files.pm") { $CORE = $_ . "/Foo/Install/"; last; } } sub deps { @{ $self->{deps} }; } sub Inline { my ($class, $lang) = @_; if ($lang ne 'C') { warn "Warning: Inline hints not available for $lang language "; return; } +{ map { (uc($_) => $self->{$_}) } qw(inc libs typemaps) }; } 1;
Subject: extutils-depends.save_config.unsorted.txt
package Foo::Install::Files; $self = { 'deps' => [ 'Gtk2', 'Cairo', 'Pango', 'Glib' ], 'inc' => '', 'libs' => '', 'typemaps' => [] }; @deps = @{ $self->{deps} }; @typemaps = @{ $self->{typemaps} }; $libs = $self->{libs}; $inc = $self->{inc}; $CORE = undef; foreach (@INC) { if ( -f $_ . "/Foo/Install/Files.pm") { $CORE = $_ . "/Foo/Install/"; last; } } sub deps { @{ $self->{deps} }; } sub Inline { my ($class, $lang) = @_; if ($lang ne 'C') { warn "Warning: Inline hints not available for $lang language "; return; } +{ map { (uc($_) => $self->{$_}) } qw(inc libs typemaps) }; } 1;
Subject: Re: [rt.cpan.org #101602] save_config produces different output on repeated invocation
Date: Wed, 28 Jan 2015 20:26:50 +0100
To: bug-ExtUtils-Depends [...] rt.cpan.org
From: Torsten Schoenfeld <kaffeetisch [...] gmx.de>
On 26.01.2015 18:30, Brian Manning via RT wrote: Show quoted text
> On Mon Jan 26 10:22:22 2015, TSCH wrote:
>> "Brian Manning via RT" <bug-ExtUtils-Depends@rt.cpan.org>:
>>> Torsten, do you see any problems with sorting dependencies in >>> save_config() and get_makefile_vars()?
>> >> The get_makefile_vars() change looks good to me. But isn't the >> save_config() change unnecessary given the commit >> <https://git.gnome.org/browse/perl-ExtUtils- >> Depends/commit/?id=64b194cfbc650f727278ce3c6e73b14904a4d219>?
> > $Data::Dumper::Sortkeys = 1 only sorts the keys inside of hashes that > are being dumped; $self->{deps} is an array of module names.
I see. In this case, yes, both patches look fine. Regression tests would be nice (but are not mandatory).
Subject: Re: [rt.cpan.org #101602] save_config produces different output on repeated invocation
Date: Thu, 29 Jan 2015 18:37:38 -0800
To: bug-ExtUtils-Depends [...] rt.cpan.org
From: Brian Manning <cpan [...] xaoc.org>
On Wed, Jan 28, 2015 at 11:27 AM, Torsten Schoenfeld via RT <bug-ExtUtils-Depends@rt.cpan.org> wrote: Show quoted text
> Queue: ExtUtils-Depends > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101602 > > > On 26.01.2015 18:30, Brian Manning via RT wrote:
>> $Data::Dumper::Sortkeys = 1 only sorts the keys inside of hashes that >> are being dumped; $self->{deps} is an array of module names.
> > I see. In this case, yes, both patches look fine. Regression tests > would be nice (but are not mandatory).
I took a look at test cases for this change yesterday, I'm not familiar enough with how save_config() and load() work to come up with a case that would exercise both, while checking the order of the modules listed inside of the $ref->{deps} attribute of an EU::D object. I'll go ahead and release EU::D with this patch (and Ed J's previous) commit, but I'm open to suggestions on how this could be tested.