Re: Parallel build issue: examples/c/lexcalc/scan.l:30:10: fatal error: parse.h: No such file or directory

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.bugs
Message-ID <[email protected]>
Hi Thomas,

> Le 5 sept. 2020 à 20:41, Thomas Deutschmann <[email protected]> a écrit :
> 
> Hi,
> 
> I found another parallel make issue:
> 
>> updating examples/c/calc/calc.output
>> updating examples/c/bistromathic/parse.output
>> updating examples/c/lexcalc/parse.output
>> examples/c/lexcalc/scan.l:30:10: fatal error: parse.h: No such file or directory
>>   30 | #include "parse.h"
>>      |          ^~~~~~~~~
>> compilation terminated.
>> make[3]: *** [Makefile:7455: examples/c/lexcalc/examples_c_lexcalc_lexcalc-scan.o] Error 1
>> make[3]: *** Waiting for unfinished jobs....
>> updating examples/c/rpcalc/rpcalc.output
>> updating examples/c/pushcalc/calc.output
>> updating examples/c/reccalc/parse.output
>> updating examples/c/calc/calc.h
>> updating examples/c/mfcalc/mfcalc.output
>> updating examples/c/bistromathic/parse.h
>> updating examples/c/lexcalc/parse.h   <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> updating examples/c++/variant-11.output
>> updating examples/c++/simple.output
>> updating examples/c++/variant.output
>> updating examples/c/rpcalc/rpcalc.h
>> updating examples/c/pushcalc/calc.h
>> updating examples/c/reccalc/parse.h
>> updating examples/c/mfcalc/mfcalc.h
>> updating examples/c++/simple.hh
>> updating examples/c++/variant-11.hh
>> updating examples/c++/variant.hh
>> make[3]: Leaving directory '/var/tmp/portage/sys-devel/bison-3.7.2/work/bison-3.7.2'
>> make[2]: *** [Makefile:9509: check-am] Error 2
>> make[2]: Leaving directory '/var/tmp/portage/sys-devel/bison-3.7.2/work/bison-3.7.2'
>> make[1]: *** [Makefile:9060: check-recursive] Error 1
>> make[1]: Leaving directory '/var/tmp/portage/sys-devel/bison-3.7.2/work/bison-3.7.2'
>> make: *** [Makefile:9512: check] Error 2

Indeed, it seems the file is created too late.  I think this patch
will address that issue.  Could you please give a try to this tarball?

https://www.lrde.epita.fr/~akim/private/bison/bison-3.7.2.2-54194.tar.gz
https://www.lrde.epita.fr/~akim/private/bison/bison-3.7.2.2-54194.tar.lz
https://www.lrde.epita.fr/~akim/private/bison/bison-3.7.2.2-54194.tar.xz

Cheers!


commit 541943ee04ee22101bbbde2386272b1cad635132
Author: Akim Demaille <[email protected]>
Date:   Sun Sep 6 10:08:22 2020 +0200

    build: fix a concurrent build issue in examples
    
    Reported by Thomas Deutschmann <[email protected]>.
    https://lists.gnu.org/r/bug-bison/2020-09/msg00010.html
    
    * examples/c/lexcalc/local.mk: scan.o depends on parse.[ch].

diff --git a/examples/c/lexcalc/local.mk b/examples/c/lexcalc/local.mk
index b73887e2..636275c8 100644
--- a/examples/c/lexcalc/local.mk
+++ b/examples/c/lexcalc/local.mk
@@ -31,6 +31,13 @@ endif FLEX_WORKS
 
 %D%/parse.c: $(dependencies)
 
+# Tell Make scan.o depends on parse.h, except that Make sees only
+# parse.c, not parse.h.  We can't use BUILT_SOURCES to this end, since
+# we use the built bison.
+%D%/lexcalc$(DASH)scan.o: %D%/parse.c
+# Likewise, but for Automake before 1.16.
+%D%/examples_c_lexcalc_lexcalc$(DASH)scan.o: %D%/parse.c
+
 EXTRA_DIST += %D%/lexcalc.test
 dist_lexcalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
 CLEANFILES += %D%/parse.[ch] %D%/scan.c %D%/parse.output
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.