augeas icon indicating copy to clipboard operation
augeas copied to clipboard

Race in building liblexer_la-lexer.lo and parser.h

Open zhurikhin opened this issue 6 years ago • 2 comments

Occasionally augeas fails to be built with the following error:

[  436s]   CC       liblexer_la-lexer.lo
[  437s] lexer.l:21:20: fatal error: parser.h: No such file or directory
[  437s]  #include "parser.h"
[  437s]                     ^
[  437s] compilation terminated.
[  437s] Makefile:1504: recipe for target 'liblexer_la-lexer.lo' failed
[  437s] make[3]: *** [liblexer_la-lexer.lo] Error 1
[  437s] make[3]: *** Waiting for unfinished jobs....
[  437s] updating parser.h
[  440s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/augeas-1.9.0/src'
[  440s] Makefile:1301: recipe for target 'all' failed
[  440s] make[2]: *** [all] Error 2
[  440s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/augeas-1.9.0/src'
[  440s] Makefile:1397: recipe for target 'all-recursive' failed
[  440s] make[1]: *** [all-recursive] Error 1
[  440s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/augeas-1.9.0'
[  440s] Makefile:1262: recipe for target 'all' failed
[  440s] make: *** [all] Error 2

It looks like there is a missing dependency between generation of 'src/parser.h' from 'src/parser.y' and its usage in 'src/lexer.c' generated from 'src/lexer.l'. Does it make sense? If yes, from my limited understanding it might be fixed by adding 'parser.h' to the 'BUILT_SOURCES' variable in 'src/Makefile.am'.

zhurikhin avatar Jul 03 '18 15:07 zhurikhin

I've never encountered this error, so it's hard for me to test the suggested fix. Can you confirm that that does indeed fix the issue for you ? If it does, I am more than happy to make the change.

lutter avatar Jul 18 '18 16:07 lutter

Hit this on a very parallel build. Adding parser.h to BUILT_SOURCES in src/Makefile.am seems to avoid the issue

pixelb avatar Feb 21 '20 17:02 pixelb