Skip Menu |
 

This queue is for tickets about the KinoSearch1 CPAN distribution.

Report information
The Basics
Id: 107019
Status: new
Priority: 0/
Queue: KinoSearch1

People
Owner: Nobody in particular
Requestors: fsfs [...] debian.org
Cc:
AdminCc:

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



Subject: libkinosearch1-perl: please make the build reproducible
Date: Thu, 10 Sep 2015 23:39:03 +0200
To: bug-kinosearch1 [...] rt.cpan.org
From: Florian Schlichting <fsfs [...] debian.org>
Download (untitled) / with headers
text/plain 1.7k
Hi, I'm forwarding Debian bug #797711 (http://bugs.debian.org/797711) and a patch by Niko Tyni: While working on the "reproducible builds" effort [0], we have noticed that the XS code generated by Build.PL depends on the order of the source files as returned by File::Find, which is nondeterministic. The attached patch fixes this. [0] https://wiki.debian.org/ReproducibleBuilds -- Niko Tyni ntyni@debian.org From efa36d64ab5be55a03deebf2fa91a4938de57fef Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Fri, 28 Aug 2015 22:49:22 +0300 Subject: [PATCH] Sort the list of source files when generating XS code The order of the file list affects generated code, so nondeterminism there renders the build unreproducible. The $first trick is a tad inelegant, but a custom sort() function that would put Kinosearch1.pm first would probably be more confusing. --- Build.PL | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Build.PL b/Build.PL index 50a466a..31fbd4f 100644 --- a/Build.PL +++ b/Build.PL @@ -37,10 +37,11 @@ my %source_pm = (); # grab all .pm filepaths, making sure that KinoSearch1.pm is first my @pm_filepaths; +my $first; find( { wanted => sub { if ( $File::Find::name =~ /KinoSearch1\.pm$/ ) { - unshift @pm_filepaths, $File::Find::name; + $first = $File::Find::name; } elsif ( $File::Find::name =~ /\.pm$/ ) { push @pm_filepaths, $File::Find::name; @@ -51,6 +52,8 @@ find( 'lib', ); +@pm_filepaths = ( $first, sort @pm_filepaths ); + for my $pm_filepath (@pm_filepaths) { open( my $module_fh, '<', $pm_filepath ) or die "couldn't open file '$pm_filepath': $!"; -- 2.1.4 Florian


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.