]> code.ossystems Code Review - openembedded-core.git/commitdiff
perl: Avoid race continually rebuilding miniperl
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 26 Jul 2020 14:02:20 +0000 (15:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Jul 2020 09:37:54 +0000 (10:37 +0100)
When we run "make install" we notice miniperl rebuilding multiple times.
Usually this is harmless however sometimes race issues occur such as
miniperl not being executable.

The issue is that crosspatch is a phony target so it always rebuilds.
Adding this as a dependency of miniperl means miniperl always rebuilds
too.

Avoid this by injecting a direct dependency avoiding the phony target.
miniperl is then only rebuilt when its input changes as desired.

Patch submitted to upstream perl-cross.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/perl/files/perl-cross-makefile.patch [new file with mode: 0644]
meta/recipes-devtools/perl/perl_5.32.0.bb

diff --git a/meta/recipes-devtools/perl/files/perl-cross-makefile.patch b/meta/recipes-devtools/perl/files/perl-cross-makefile.patch
new file mode 100644 (file)
index 0000000..5d3f998
--- /dev/null
@@ -0,0 +1,29 @@
+Makefile: Avoid continual rebuilds of miniperl and associated races 
+
+In the Yocto Project, when we run "make install" we notice miniperl
+rebuilding multiple times. Usually this is harmless however sometimes
+race issues occur such as miniperl not being executable.
+
+The issue is that crosspatch is a phony target so it always rebuilds.
+Adding this as a dependency of miniperl means miniperl always rebuilds
+too.
+
+Avoid this by injecting a direct dependency avoiding the phony target.
+miniperl is then only rebuilt when its input changes as desired.
+
+Signed-off-by: Richard Purdie richard.purdie@linuxfoundation.org
+Upstream-Status: Submitted [https://github.com/arsv/perl-cross/pull/95]
+
+Index: perl-5.32.0/Makefile
+===================================================================
+--- perl-5.32.0.orig/Makefile
++++ perl-5.32.0/Makefile
+@@ -56,7 +56,7 @@ crosspatch: $(CROSSPATCHED)
+ # A minor fix for buildroot, force crosspatching when running "make perl modules"
+ # instead of "make all".
+-miniperlmain$O: crosspatch
++miniperlmain$O: $(CROSSPATCHED)
+ # Original versions are not saved anymore; patch generally takes care of this,
+ # and if that fails, reaching for the source tarball is the safest option.
index 1adfd90e7398267b2619b6d027ff9138adfc890e..c10ce123030752825a7c0bb9ee6741e3778b44bf 100644 (file)
@@ -20,6 +20,7 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
            file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \
            file://0002-Constant-Fix-up-shebang.patch \
            file://determinism.patch  \
+           file://perl-cross-makefile.patch \
            "
 SRC_URI_append_class-native = " \
            file://perl-configpm-switch.patch \