diff --git a/gnu/local.mk b/gnu/local.mk index 04f895b71f..1578f4f9df 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1320,6 +1320,7 @@ dist_patch_DATA = \ %D%/packages/patches/flatpak-fix-fonts-icons.patch \ %D%/packages/patches/flatpak-fix-icon-validation.patch \ %D%/packages/patches/flatpak-unset-gdk-pixbuf-for-sandbox.patch \ + %D%/packages/patches/flex-fix-make-dependencies.patch \ %D%/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch \ %D%/packages/patches/fluxbox-1.3.7-gcc.patch \ %D%/packages/patches/fmt-9-overspecified-tests.patch \ diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index c591ed1c76..d387abb92e 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -2649,6 +2649,7 @@ exec " gcc-bin "/" program ;; This Flex is needed to build MiG as well as Linux-Libre headers. (package (inherit flex) + (source (bootstrap-origin (package-source flex))) (native-inputs (list bison-boot0)) (propagated-inputs (list m4-boot0)) (inputs (%boot0-inputs)) diff --git a/gnu/packages/flex.scm b/gnu/packages/flex.scm index 871f1645ba..1e08dbd0e5 100644 --- a/gnu/packages/flex.scm +++ b/gnu/packages/flex.scm @@ -26,6 +26,7 @@ #:use-module (guix gexp) #:use-module (guix utils) #:use-module (gnu packages) + #:use-module (gnu packages bootstrap) #:use-module (gnu packages m4) #:use-module (gnu packages man) #:use-module (gnu packages bison) @@ -43,7 +44,8 @@ "flex-" version ".tar.gz")) (sha256 (base32 - "15g9bv236nzi665p9ggqjlfn4dwck5835vf0bbw2cz7h5c1swyp8")))) + "15g9bv236nzi665p9ggqjlfn4dwck5835vf0bbw2cz7h5c1swyp8")) + (patches (search-patches "flex-fix-make-dependencies.patch")))) (build-system gnu-build-system) (arguments (if (%current-target-system) diff --git a/gnu/packages/patches/flex-fix-make-dependencies.patch b/gnu/packages/patches/flex-fix-make-dependencies.patch new file mode 100644 index 0000000000..dbe9392a26 --- /dev/null +++ b/gnu/packages/patches/flex-fix-make-dependencies.patch @@ -0,0 +1,54 @@ +Retrieved from Poky: +https://git.enea.com/cgit/linux/poky.git/plain/meta/recipes-devtools/flex/flex/0001-build-tests-add-missing-parser-scanner-dependencies.patch?id=bf94ea1cc4e966fa2cf55206389f9c34fbd5419d + +From 47e3916842ffefd7def84ae85758fdcceeb77839 Mon Sep 17 00:00:00 2001 +From: Ross Burton +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 +--- + 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 +