]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
flex: build occasional build failures in test suite compile
authorRoss Burton <ross.burton@arm.com>
Wed, 26 Mar 2025 12:11:50 +0000 (12:11 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Mar 2025 11:18:40 +0000 (11:18 +0000)
GNU Make 4.4 has added --shuffle, which randomly orders build jobs and
is great at exposing missing dependencies. Using this the known problem
with the flex test suite build was found and resolved, so remove the
workaround of doing a non-parallel build and apply a patch.

Also remove redundant Make variables that shouldn't be needed to build
the test suite.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/flex/flex/0001-build-tests-add-missing-parser-scanner-dependencies.patch [new file with mode: 0644]
meta/recipes-devtools/flex/flex_2.6.4.bb

diff --git a/meta/recipes-devtools/flex/flex/0001-build-tests-add-missing-parser-scanner-dependencies.patch b/meta/recipes-devtools/flex/flex/0001-build-tests-add-missing-parser-scanner-dependencies.patch
new file mode 100644 (file)
index 0000000..130eccc
--- /dev/null
@@ -0,0 +1,51 @@
+From 47e3916842ffefd7def84ae85758fdcceeb77839 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Thu, 20 Mar 2025 12:16:50 +0000
+Subject: [PATCH] build(tests): add missing parser->scanner dependencies
+
+With sufficient parallelism and `make --shuffle` to reorder builds the
+test suite occasionally fails to build with errors like this:
+
+ tests/bison_yylval_parser.y:36:10: fatal error: bison_yylval_scanner.h: No such file or directory
+    36 | #include "bison_yylval_scanner.h"
+
+Solve this by adding the missing dependencies to the *_parser.o targets
+on the _scanner.h files.
+
+Upstream-Status: Submitted [https://github.com/westes/flex/pull/702]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ tests/Makefile.am | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 2cb51df..d0c199d 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -343,6 +343,7 @@ FLEX = $(top_builddir)/src/flex
+ bison_nr_main.$(OBJEXT): bison_nr_parser.h bison_nr_scanner.h
+ bison_nr_scanner.$(OBJEXT): bison_nr_parser.h
++bison_nr_parser.$(OBJEXT): bison_nr_scanner.h
+ bison_nr_scanner.h: bison_nr_scanner.c
+       @if test ! -f $@; then rm -f $<; else :; fi
+@@ -350,6 +351,7 @@ bison_nr_scanner.h: bison_nr_scanner.c
+ bison_yylloc_main.$(OBJEXT): bison_yylloc_parser.h bison_yylloc_scanner.h
+ bison_yylloc_scanner.$(OBJEXT): bison_yylloc_parser.h
++bison_yylloc_parser.$(OBJEXT): bison_yylloc_scanner.h
+ bison_yylloc_scanner.h: bison_yylloc_scanner.c
+       @if test ! -f $@; then rm -f $<; else :; fi
+@@ -357,6 +359,7 @@ bison_yylloc_scanner.h: bison_yylloc_scanner.c
+ bison_yylval_main.$(OBJEXT): bison_yylval_parser.h bison_yylval_scanner.h
+ bison_yylval_scanner.$(OBJEXT): bison_yylval_parser.h
++bison_yylval_parser.$(OBJEXT): bison_yylval_scanner.h
+ bison_yylval_scanner.h: bison_yylval_scanner.c
+       @if test ! -f $@; then rm -f $<; else :; fi
+-- 
+2.43.0
+
index 434ce47c03a288b960eac260e75c49e4ce40c089..793a935962e9abc9eee67e150d642b36ec461db9 100644 (file)
@@ -18,6 +18,7 @@ SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/flex-${PV}.tar.gz \
            file://0001-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch \
            file://check-funcs.patch \
            file://0001-Emit-no-line-directives-if-gen_line_dirs-is-false.patch \
+           file://0001-build-tests-add-missing-parser-scanner-dependencies.patch \
            "
 
 SRC_URI[md5sum] = "2882e3179748cc9f9c23ec593d6adc8d"
@@ -55,9 +56,8 @@ RDEPENDS:${PN} += "m4"
 RDEPENDS:${PN}-ptest += "bash gawk make"
 
 do_compile_ptest() {
-       oe_runmake -C ${B}/tests -f ${B}/tests/Makefile top_builddir=${B} INCLUDES=-I${S}/src buildtests
+       oe_runmake -C ${B}/tests buildtests
 }
-PTEST_PARALLEL_MAKE = ""
 
 do_install_ptest() {
        mkdir -p ${D}${PTEST_PATH}/build-aux/