[pdl] 01/02: Add patches by Reiner Herrmann for reproducible builds.
Bas Couwenberg
sebastic at debian.org
Sat Jul 2 22:53:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository pdl.
commit 69a5664e170d816a870ff65c9a5269f15e19b508
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Sun Jul 3 00:33:09 2016 +0200
Add patches by Reiner Herrmann for reproducible builds.
---
debian/changelog | 7 +++
debian/patches/reproducible-build.patch | 107 ++++++++++++++++++++++++++++++++
debian/patches/series | 2 +
debian/patches/sorted_output.patch | 54 ++++++++++++++++
4 files changed, 170 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 6bc4cf8..8c056e3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+pdl (1:2.016-3) UNRELEASED; urgency=medium
+
+ * Add patches by Reiner Herrmann for reproducible builds.
+ (closes: #829323, #829365)
+
+ -- Bas Couwenberg <sebastic at debian.org> Sun, 03 Jul 2016 00:29:08 +0200
+
pdl (1:2.016-2) unstable; urgency=medium
* Team upload.
diff --git a/debian/patches/reproducible-build.patch b/debian/patches/reproducible-build.patch
new file mode 100644
index 0000000..298f0d2
--- /dev/null
+++ b/debian/patches/reproducible-build.patch
@@ -0,0 +1,107 @@
+Description: Fix non-deterministic order in several files for reproducible builds.
+Author: Reiner Herrmann <reiner at reiner-h.de>
+Bug-Debian: https://bugs.debian.org/829365
+Forwarded: https://sourceforge.net/p/pdl/patches/84/
+
+--- a/Basic/Core/pdlcore.h.PL
++++ b/Basic/Core/pdlcore.h.PL
+@@ -148,7 +148,7 @@ pdl* pdl_from_array(AV* av, AV* dims, in
+
+ !NO!SUBS!
+
+-for my $in ( keys %PDL_DATATYPES ) {
++for my $in ( sort keys %PDL_DATATYPES ) {
+
+ (my $type = $PDL_DATATYPES{$in}) =~ s/^PDL_//;
+ print OUT <<"!WITH!SUBS!";
+@@ -351,7 +351,7 @@ double NaN_double;
+ # file
+ require "Types.pm"; # ie PDL::Types
+
+-for (keys %PDL::Types::typehash) {
++for (sort keys %PDL::Types::typehash) {
+ my $ctype = $PDL::Types::typehash{$_}{ctype};
+ my $ppsym = $PDL::Types::typehash{$_}{ppsym};
+
+--- a/Basic/Slices/slices.pd
++++ b/Basic/Slices/slices.pd
+@@ -2899,7 +2899,7 @@ $sliceb_data_kludge = <<'KLUDGE';
+ switch( p->datatype ) {
+ KLUDGE
+
+-for my $type(keys %PDL::Types::typehash) {
++for my $type(sort keys %PDL::Types::typehash) {
+ $sliceb_data_kludge .=
+ " case $type: nn = *( ($PDL::Types::typehash{$type}->{realctype} *)(p->data) ); break;\n";
+ }
+--- a/Basic/Ufunc/ufunc.pd
++++ b/Basic/Ufunc/ufunc.pd
+@@ -126,7 +126,7 @@ my %over =
+ prodover => { name => 'product', op => '*=', init => 1, },
+ );
+
+-foreach my $func ( keys %over ) {
++foreach my $func ( sort keys %over ) {
+
+ # creates $func and cumu$func functions
+ # and d$func and dcumu$func functions, which
+@@ -243,7 +243,7 @@ foreach my $func ( keys %over ) {
+
+ );
+
+-foreach my $func ( keys %over ) {
++foreach my $func ( sort keys %over ) {
+
+ my $def = $over{$func}{def};
+ my $txt = $over{$func}{txt};
+@@ -438,7 +438,7 @@ EOD
+ # note: we export them to the PDL Core structure for use in
+ # other modules (eg Image2D)
+
+-for (keys %PDL::Types::typehash) {
++for (sort keys %PDL::Types::typehash) {
+ my $ctype = $PDL::Types::typehash{$_}{ctype};
+ my $ppsym = $PDL::Types::typehash{$_}{ppsym};
+
+--- a/Lib/Image2D/image2d.pd
++++ b/Lib/Image2D/image2d.pd
+@@ -137,7 +137,7 @@ my %pnpolyFields = (
+ 'pnpolyfill_pp' => {'pars' => '[o,nc] a(m,n); ps(k,l); int col()', 'special' => 'if(c) { $a() = $col(); }'}
+ );
+
+-for my $name (keys %pnpolyFields) {
++for my $name (sort keys %pnpolyFields) {
+ pp_def($name,
+ HandleBad => 0,
+ PMFunc => '',
+@@ -193,7 +193,7 @@ pp_addhdr('
+
+ ');
+
+-for (keys %PDL::Types::typehash) {
++for (sort keys %PDL::Types::typehash) {
+ my $ctype = $PDL::Types::typehash{$_}{ctype};
+ my $ppsym = $PDL::Types::typehash{$_}{ppsym};
+
+--- a/Lib/Slatec/slatec.pd
++++ b/Lib/Slatec/slatec.pd
+@@ -375,7 +375,7 @@ sub defslatec {
+ my @talts = map {
+ defined $ftypes{$_} or die "FTYPE $_ NOT THERE\n";
+ [$ftypes{$_},$fnames->{$_}]
+- } keys %$fnames;
++ } sort keys %$fnames;
+
+ my $func = "\$T".(join '',map {$_->[0]} @talts) . "(" .
+ (join ',',map {$_->[1].$uscore} @talts).")";
+--- a/IO/HDF/buildfunc.pm
++++ b/IO/HDF/buildfunc.pm
+@@ -82,7 +82,7 @@ sub create_low_level
+ # Add the OUTPUT section:
+ $xsout .= "OUTPUT:\n";
+ $xsout .= "\tRETVAL\n";
+- foreach my $var ( keys %$output )
++ foreach my $var ( sort keys %$output )
+ {
+ $xsout .= "\t$var\n";
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 1e2152a..58e3d1f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,5 @@ manpage-has-bad-whatis-entry.patch
pdl-ldflags.patch
absolute-doc-paths.patch
spelling-errors2.patch
+sorted_output.patch
+reproducible-build.patch
diff --git a/debian/patches/sorted_output.patch b/debian/patches/sorted_output.patch
new file mode 100644
index 0000000..eee8e19
--- /dev/null
+++ b/debian/patches/sorted_output.patch
@@ -0,0 +1,54 @@
+Description: Sort output to make generated code reproducible.
+Author: Reiner Herrmann <reiner at reiner-h.de>
+Bug-Debian: https://bugs.debian.org/829323
+Forwarded: https://sourceforge.net/p/pdl/patches/84/
+
+--- a/Basic/Gen/PP.pm
++++ b/Basic/Gen/PP.pm
+@@ -2616,7 +2616,7 @@ sub make_incsizes {
+ my($parnames,$parobjs,$dimobjs,$havethreading) = @_;
+ my $str = ($havethreading?"pdl_thread __pdlthread; ":"").
+ (join '',map {$parobjs->{$_}->get_incdecls} @$parnames).
+- (join '',map {$_->get_decldim} values %$dimobjs);
++ (join '',sort map {$_->get_decldim} values %$dimobjs);
+ return ($str,undef);
+ }
+
+@@ -2627,7 +2627,7 @@ sub make_incsize_copy {
+ : "").
+ (join '',map {$parobjs->{$_}->get_incdecl_copy(sub{"\$PRIV($_[0])"},
+ sub{"$copyname->$_[0]"})} @$parnames).
+- (join '',map {$_->get_copydim(sub{"\$PRIV($_[0])"},
++ (join '',sort map {$_->get_copydim(sub{"\$PRIV($_[0])"},
+ sub{"$copyname->$_[0]"})} values %$dimobjs);
+
+ }
+@@ -2790,7 +2790,7 @@ sub make_redodims_thread {
+ my $nn = $#$pnames;
+ my @privname = map { "\$PRIV(pdls[$_])" } ( 0 .. $nn );
+ $str .= $npdls ? "PDL_Indx __creating[$npdls];\n" : "PDL_Indx __creating[1];\n";
+- $str .= join '',map {$_->get_initdim."\n"} values %$dobjs;
++ $str .= join '',sort map {$_->get_initdim."\n"} values %$dobjs;
+
+ # if FlagCreat is NOT true, then we set __creating[] to 0
+ # and we can use this knowledge below, and in hdrcheck()
+--- a/Basic/Gen/PP/PDLCode.pm
++++ b/Basic/Gen/PP/PDLCode.pm
+@@ -75,7 +75,7 @@ sub new {
+ Name => $name,
+ }, $type;
+
+- my $inccode = join '',map {$_->get_incregisters();} (values %{$this->{ParObjs}});
++ my $inccode = join '',sort map {$_->get_incregisters();} (values %{$this->{ParObjs}});
+
+ # First, separate the code into an array of C fragments (strings),
+ # variable references (strings starting with $) and
+@@ -165,7 +165,7 @@ sub new {
+
+ # Then, in this form, put it together what we want the code to actually do.
+ print "SIZEPRIVS: ",(join ',',%$sizeprivs),"\n" if $::PP_VERBOSE;
+- $this->{Code} = "{".(join '',values %$sizeprivs).
++ $this->{Code} = "{".(join '',sort values %$sizeprivs).
+ $coderef->get_str($this,[])
+ ."}";
+ $this->{Code};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pdl.git
More information about the Pkg-perl-cvs-commits
mailing list