Skip to contentSkip to conversation

perl: Reproducible build fixes

PATCH In review Joshua Watt 2 participants 2 messages Jun 21, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perl: Reproducible build fixes

Applies two patches that are required to improve the reproducibility of builds.

---
 ...onment-variable-to-suppress-comments.patch | 30 +++++++++++++++++
 .../files/0002-Constant-Fix-up-shebang.patch  | 32 +++++++++++++++++++
 meta/recipes-devtools/perl/perl_5.30.0.bb     |  5 +++
 3 files changed, 67 insertions(+)
 create mode 100644 meta/recipes-devtools/perl/files/0001-enc2xs-Add-environment-variable-to-suppress-comments.patch
 create mode 100644 meta/recipes-devtools/perl/files/0002-Constant-Fix-up-shebang.patch
meta/recipes-devtools/perl/files/0001-enc2xs-Add-environment-variable-to-suppress-comments.patch new file +30 -0
new file mode 100644
index 00000000000..07f153162b0
@@ -0,0 +1,30 @@
+From 31a2c5555f9ef32f35d7d5ce1fd09a010ba5f5c6 Mon Sep 17 00:00:00 2001
+From: Joshua Watt <[email protected]>
+Date: Mon, 17 Jun 2019 10:47:15 -0500
+Subject: [PATCH 1/2] enc2xs: Add environment variable to suppress comments
+
+Comment generation in enc2xs can now be suppressed by setting the
+ENC2XS_NO_COMMENTS environment variable. This allows enc2xs to produce
+reproducible output by omitting the name of the generating program.
+
+Signed-off-by: Joshua Watt <[email protected]>
+Upstream-status: Accepted [https://github.com/dankogai/p5-encode/pull/145]
+---
+ cpan/Encode/bin/enc2xs | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
+index 619b64b757..bfce9ee735 100644
+--- a/cpan/Encode/bin/enc2xs
++++ b/cpan/Encode/bin/enc2xs
+@@ -144,6 +144,7 @@ getopts('CM:SQqOo:f:n:v',\%opt);
+ $opt{M} and make_makefile_pl($opt{M}, @ARGV);
+ $opt{C} and make_configlocal_pm($opt{C}, @ARGV);
+ $opt{v} ||= $ENV{ENC2XS_VERBOSE};
++$opt{q} ||= $ENV{ENC2XS_NO_COMMENTS};
+ 
+ sub verbose {
+     print STDERR @_ if $opt{v};
+-- 
+2.21.0
+
meta/recipes-devtools/perl/files/0002-Constant-Fix-up-shebang.patch new file +32 -0
new file mode 100644
index 00000000000..e70ff67f726
@@ -0,0 +1,32 @@
+From 260ebd15e16cd86b9b58e5c5f3a496b3853ca46d Mon Sep 17 00:00:00 2001
+From: Joshua Watt <[email protected]>
+Date: Mon, 17 Jun 2019 10:47:23 -0500
+Subject: [PATCH 2/2] Constant: Fix up shebang
+
+The instructions indicate that the script should be explicitly passed to
+"perl -x", so automatically setting the #! to be ^X is unnecessary and
+makes the file non-reproducible when building because ^X could be the
+absolute path to miniperl.
+
+Signed-off-by: Joshua Watt <[email protected]>
+Upstream-status: Submitted [https://rt.cpan.org/Public/Bug/Display.html?id=129866]
+---
+ cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm
+index 14eb809714..d4d074e121 100644
+--- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm
++++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm
+@@ -219,7 +219,7 @@ sub dogfood {
+      Regenerate these constant functions by feeding this entire source file to
+      perl -x
+ 
+-#!$^X -w
++#!/usr/bin/env perl -x -w
+ use ExtUtils::Constant qw (constant_types C_constant XS_constant);
+ 
+ EOT
+-- 
+2.21.0
+
meta/recipes-devtools/perl/perl_5.30.0.bb +5 -0
index b18a6b69131..e3664290e30 100644
@@ -19,6 +19,8 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
            file://perl-dynloader.patch \
            file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \
            file://fix-setgroup.patch \
+           file://0001-enc2xs-Add-environment-variable-to-suppress-comments.patch \
+           file://0002-Constant-Fix-up-shebang.patch \
            "
 SRC_URI_append_class-native = " \
            file://perl-configpm-switch.patch \
@@ -37,6 +39,9 @@ DEPENDS += "db gdbm zlib virtual/crypt"
 
 PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0"
 
+# Don't generate comments in enc2xs output files. They are not reproducible
+export ENC2XS_NO_COMMENTS = "1"
+
 do_unpack_append() {
     bb.build.exec_func('do_copy_perlcross', d)
 }
Signature · 1 line
2.21.0
#1 lore raw

✗ patchtest: failure for perl: Reproducible build fixes

== Series Details ==

Series: perl: Reproducible build fixes
Revision: 1
URL : https://patchwork.openembedded.org/series/18288/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Upstream-Status is in incorrect format [test_upstream_status_presence_format]

  Suggested fix    Fix Upstream-Status format in 0001-enc2xs-Add-environment-variable-to-suppress-comments.patch
  Current          Upstream-status: Accepted [https://github.com/dankogai/p5-encode/pull/145]
  Standard format  Upstream-Status: <Valid status>
  Valid status     Pending, Accepted, Backport, Denied, Inappropriate [reason], Submitted [where]

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe