Hi,

On Sun, 18 Jan 2015 16:13:10 +0100 Reiner Herrmann <rei...@reiner-h.de> wrote:
> While working on the “reproducible builds” effort [1], we have noticed
> that packages using ExtUtils::Depends contain differing files after
> each build, because the dependency list is not sorted in save_config.
>
> The attached patch, which has already been forwarded upstream [2], fixes this.

we noticed an additional issue with ExtUtils::Depends. When building package
xacobeo the linking order was random due to an unsorted iteration over the keys
of a perl hash.

The attached patch includes Reiner's initial patch and the fix to this
additional problem.

We also submitted the issue to upstream as part of the same bug Reiner opened.

We maintain a git repository including this patch as part of the experimental
reproducible build effort. So alternatively you can also clone from:

https://anonscm.debian.org/git/reproducible/libextutils-depends-perl.git

or look at it in the web interface at:

https://anonscm.debian.org/cgit/reproducible/libextutils-depends-perl.git/

Cheers, akira
From 70554121a70f79f9d0b998fe01c8a70bfb566fc8 Mon Sep 17 00:00:00 2001
From: akira <marival...@gmail.com>
Date: Wed, 21 Jan 2015 22:08:19 +0100
Subject: [PATCH] Added patch to produce stable output

 - in saved configs by Reiner Herrmann
 - linking order
---
 debian/changelog                          |  7 +++++++
 debian/patches/deterministic_output.patch | 26 ++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 3 files changed, 34 insertions(+)
 create mode 100644 debian/patches/deterministic_output.patch
 create mode 100644 debian/patches/series

diff --git a/debian/changelog b/debian/changelog
index d011462..c974727 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libextutils-depends-perl (0.402-1.0~reproducible) UNRELEASED; urgency=low
+
+  * Added patch to produce stable output in saved configs and linking order 
+    includes patch by Reiner Herrmann (closes:775678)
+
+ -- Maria Valentina Marin <marival...@gmail.com>  Wed, 21 Jan 2015 22:02:54 +0100
+
 libextutils-depends-perl (0.402-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/deterministic_output.patch b/debian/patches/deterministic_output.patch
new file mode 100644
index 0000000..e153a82
--- /dev/null
+++ b/debian/patches/deterministic_output.patch
@@ -0,0 +1,26 @@
+Subject: Sort keys to get the same output on every invocation
+Author: Maria Valentina Marin <marival...@gmail.com>
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=101602
+Bug-Debian: https://bugs.debian.org/775678
+
+--- libextutils-depends-perl-0.402.orig/lib/ExtUtils/Depends.pm
++++ libextutils-depends-perl-0.402/lib/ExtUtils/Depends.pm
+@@ -127,7 +127,7 @@ sub save_config {
+ 		inc => join (" ", @{ $self->{inc} }),
+ 		libs => $self->{libs},
+ 		typemaps => [ map { basename $_ } @{ $self->{typemaps} } ],
+-		deps => [keys %{ $self->{deps} }],
++		deps => [sort keys %{ $self->{deps} }],
+ 	}], ['self']);
+ 	print $file <<'EOF';
+ 
+@@ -271,7 +271,7 @@ sub get_makefile_vars {
+ 	my @incbits = map { split } @{ $self->{inc} };
+ 	my @libsbits = split /\s+/, $self->{libs};
+ 	my @typemaps = @{ $self->{typemaps} };
+-	foreach my $d (keys %{ $self->{deps} }) {
++	foreach my $d (sort keys %{ $self->{deps} }) {
+ 		my $dep = $self->{deps}{$d};
+ 		#push @defbits, @{ $dep->{defines} };
+ 		push @incbits, @{ $dep->{defines} } if $dep->{defines};
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..155adf7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+deterministic_output.patch
-- 
2.1.1

Reply via email to