summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-02-09 22:45:06 +0000
committerSam James <sam@gentoo.org>2023-02-09 22:52:49 +0000
commit5f14870405eb92a33d12a55c38fa67ffe93b9a86 (patch)
tree7d9efb4e99b6b0d2233805d26c59c6c9f26f42ed /sys-devel/reflex
parenttoolchain.eclass: Register the D tc_feature (diff)
downloadgentoo-5f14870405eb92a33d12a55c38fa67ffe93b9a86.tar.gz
gentoo-5f14870405eb92a33d12a55c38fa67ffe93b9a86.tar.bz2
gentoo-5f14870405eb92a33d12a55c38fa67ffe93b9a86.zip
sys-devel/reflex: fix parallel build
Closes: https://bugs.gentoo.org/883611 Thanks-to: Arsen Arsenović <arsen@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-devel/reflex')
-rw-r--r--sys-devel/reflex/files/reflex-20230206-parallel-build.patch54
-rw-r--r--sys-devel/reflex/reflex-20230206.ebuild7
2 files changed, 57 insertions, 4 deletions
diff --git a/sys-devel/reflex/files/reflex-20230206-parallel-build.patch b/sys-devel/reflex/files/reflex-20230206-parallel-build.patch
new file mode 100644
index 000000000000..ecfadc14639f
--- /dev/null
+++ b/sys-devel/reflex/files/reflex-20230206-parallel-build.patch
@@ -0,0 +1,54 @@
+From 16cc516dfbb6dac01fcd0bfcb717a681b132c0b4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@gentoo.org>
+Date: Thu, 9 Feb 2023 20:34:48 +0100
+Subject: [PATCH] Remove .bootstrap and scan.c target race
+
+If the parallelism of a make invocation is great enough to generate both
+.bootstrap and scan.c simultaneously, there's a great chance that the
+rule in .bootstrap will be overruled by the (possibly failing)
+redirection in the scan.c, resulting in an empty scan.c and a failing
+build. Instead, we can use an empty scan.c as an (inaccurate) proxy for
+the boostrap.
+
+Bug: https://bugs.gentoo.org/883611
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -126,14 +126,9 @@ PERF_REPORT = -p
+
+ all: $(FLEX)
+
+-$(FLEX): .bootstrap $(OBJECTS) $(FLEXLIB)
++$(FLEX): $(OBJECTS) $(FLEXLIB)
+ @ECHO_LD@$(CC) $(CFLAGS) -o $(FLEX) $(LDFLAGS) $(OBJECTS) $(FLEXLIB) $(LIBS)
+
+-.bootstrap: initscan.c
+- @rm -f scan.c
+- cp $(srcdir)/initscan.c scan.c
+- touch .bootstrap
+-
+ parse.c: parse.y
+ $(YACC) -d $(srcdir)/parse.y
+ @sed '/extern char.*malloc/d' <y.tab.c >parse.tmp
+@@ -145,6 +140,7 @@ parse.h: parse.c
+
+ scan.c: scan.l
+ $(SHELL) $(srcdir)/mkscan.sh $(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.c
++ grep . $@ || cp initscan.c scan.c
+
+ scan$o: scan.c parse.h flexdef.h config.h
+ yylex$o: yylex.c parse.h flexdef.h config.h
+@@ -259,8 +255,8 @@ clean :: mostlyclean
+ $(FLEXLIB) config.log config.cache
+
+ distclean :: clean
+- rm -f .bootstrap $(FLEX) scan.c tags TAGS Makefile man2html.tmp \
+- config.status config.h stamp-h config.log config.cache
++ rm -f $(FLEX) scan.c tags TAGS Makefile man2html.tmp config.status \
++ config.h stamp-h config.log config.cache
+
+ maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+--
+2.39.1
+
+
diff --git a/sys-devel/reflex/reflex-20230206.ebuild b/sys-devel/reflex/reflex-20230206.ebuild
index 9510513ed2ba..730f0aa25747 100644
--- a/sys-devel/reflex/reflex-20230206.ebuild
+++ b/sys-devel/reflex/reflex-20230206.ebuild
@@ -17,10 +17,9 @@ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~ppc ~ppc64 ~riscv ~s390 ~
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomasdickey )"
-src_compile() {
- # bug #883611
- emake -j1
-}
+PATCHES=(
+ "${FILESDIR}"/reflex-20230206-parallel-build.patch
+)
src_install() {
default