diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-05 23:54:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-11 23:05:12 +0000 |
commit | 02cbb680a954244eafc27aec4d64429ffc05860d (patch) | |
tree | 002a9674aeedc1656f41f23c1c81614e4af6ee6f /meta/recipes-devtools/perl/files/determinism.patch | |
parent | ed51e1231ac38fddac36095541a0dac33733b002 (diff) | |
download | poky-02cbb680a954244eafc27aec4d64429ffc05860d.tar.gz |
perl: Fix various reproducibile build issues
Add a patch which handles the following issues:
a) Remove the \n from configure_attr.sh since it gets quoted differently depending on
whether the shell is bash or dash which can cause the test result to be incorrect.
Reported upstream: https://github.com/arsv/perl-cross/issues/87
b) Sort the order of the module lists from configure_mods.sh since otherwise
the result isn't the same leading to makefile differences.
Reported upstream: https://github.com/arsv/perl-cross/issues/88
c) Sort the Encode::Byte byte_t.fnm file output (and the makefile depends whilst
there for good measure)
This needs to go to upstream perl (not done)
d) Use bash for perl-cross configure since otherwise trnl gets set to "\n" with bash
and "" with dash
Reported upstream: https://github.com/arsv/perl-cross/issues/87
(From OE-Core rev: 482fd0d99f989b5a72a25bdf402fb2f219420b5d)
(From OE-Core rev: def3a9d748564883d71c506726554df622701b00)
(From OE-Core rev: 1f630fe43ec3c3e78c25f93d6badc8a35ff782ad)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/perl/files/determinism.patch')
-rw-r--r-- | meta/recipes-devtools/perl/files/determinism.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/files/determinism.patch b/meta/recipes-devtools/perl/files/determinism.patch new file mode 100644 index 0000000000..ed4d06f5ec --- /dev/null +++ b/meta/recipes-devtools/perl/files/determinism.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | Fixes to make the perl build reproducible: | ||
2 | |||
3 | a) Remove the \n from configure_attr.sh since it gets quoted differently depending on | ||
4 | whether the shell is bash or dash which can cause the test result to be incorrect. | ||
5 | Reported upstream: https://github.com/arsv/perl-cross/issues/87 | ||
6 | |||
7 | b) Sort the order of the module lists from configure_mods.sh since otherwise | ||
8 | the result isn't the same leading to makefile differences. | ||
9 | Reported upstream: https://github.com/arsv/perl-cross/issues/88 | ||
10 | |||
11 | c) Sort the Encode::Byte byte_t.fnm file output (and the makefile depends whilst | ||
12 | there for good measure) | ||
13 | This needs to go to upstream perl (not done) | ||
14 | |||
15 | d) Use bash for perl-cross configure since otherwise trnl gets set to "\n" with bash | ||
16 | and "" with dash | ||
17 | Reported upstream: https://github.com/arsv/perl-cross/issues/87 | ||
18 | |||
19 | RP 2020/2/7 | ||
20 | |||
21 | Upstream-Status: Pending [75% submitted] | ||
22 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org | ||
23 | |||
24 | Index: perl-5.30.1/cnf/configure_attr.sh | ||
25 | =================================================================== | ||
26 | --- perl-5.30.1.orig/cnf/configure_attr.sh | ||
27 | +++ perl-5.30.1/cnf/configure_attr.sh | ||
28 | @@ -131,7 +131,7 @@ if not hinted d_c99_variadic_macros 'sup | ||
29 | try_start | ||
30 | try_add '#include <stdio.h>' | ||
31 | try_add '#define foo(fmt, ...) printf(fmt, __VA_ARGS__)' | ||
32 | - try_add 'int main(void) { foo("%i\n", 1234); return 0; }' | ||
33 | + try_add 'int main(void) { foo("%i", 1234); return 0; }' | ||
34 | try_compile | ||
35 | resdef d_c99_variadic_macros 'supported' 'missing' | ||
36 | fi | ||
37 | Index: perl-5.30.1/cnf/configure_mods.sh | ||
38 | =================================================================== | ||
39 | --- perl-5.30.1.orig/cnf/configure_mods.sh | ||
40 | +++ perl-5.30.1/cnf/configure_mods.sh | ||
41 | @@ -82,7 +82,7 @@ extonlyif() { | ||
42 | } | ||
43 | |||
44 | definetrimspaces() { | ||
45 | - v=`echo "$2" | sed -r -e 's/\s+/ /g' -e 's/^\s+//' -e 's/\s+$//'` | ||
46 | + v=`echo "$2" | sed -r -e 's/\s+/ /g' -e 's/^\s+//' -e 's/\s+$//' | xargs -n1 | LANG=C sort | xargs` | ||
47 | define $1 "$v" | ||
48 | } | ||
49 | |||
50 | Index: perl-5.30.1/cpan/Encode/Byte/Makefile.PL | ||
51 | =================================================================== | ||
52 | --- perl-5.30.1.orig/cpan/Encode/Byte/Makefile.PL | ||
53 | +++ perl-5.30.1/cpan/Encode/Byte/Makefile.PL | ||
54 | @@ -171,7 +171,7 @@ sub postamble | ||
55 | my $lengthsofar = length($str); | ||
56 | my $continuator = ''; | ||
57 | $str .= "$table.c : $enc2xs Makefile.PL"; | ||
58 | - foreach my $file (@{$tables{$table}}) | ||
59 | + foreach my $file (sort (@{$tables{$table}})) | ||
60 | { | ||
61 | $str .= $continuator.' '.$self->catfile($dir,$file); | ||
62 | if ( length($str)-$lengthsofar > 128*$numlines ) | ||
63 | @@ -189,7 +189,7 @@ sub postamble | ||
64 | qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; | ||
65 | open (FILELIST, ">$table.fnm") | ||
66 | || die "Could not open $table.fnm: $!"; | ||
67 | - foreach my $file (@{$tables{$table}}) | ||
68 | + foreach my $file (sort (@{$tables{$table}})) | ||
69 | { | ||
70 | print FILELIST $self->catfile($dir,$file) . "\n"; | ||
71 | } | ||
72 | Index: perl-5.30.1/cnf/configure | ||
73 | =================================================================== | ||
74 | --- perl-5.30.1.orig/cnf/configure | ||
75 | +++ perl-5.30.1/cnf/configure | ||
76 | @@ -1,4 +1,4 @@ | ||
77 | -#!/bin/sh | ||
78 | +#!/bin/bash | ||
79 | |||
80 | base=${0%/*}; test -z "$base" && base=. | ||
81 | |||