Jumbled up errors when generating parsers with multiple make jobs
Errors don't make much sense if you would attempt to solve them individually:
dhcp4_parser.h:2642: error: unterminated #else
2642 | #if 201103L <= YY_CPLUSPLUS
|
In file included from ../../../src/bin/dhcp4/parser_context.h:12,
from parser_context.cc:9:
../../../src/bin/dhcp4/dhcp4_parser.h:45: error: unterminated #ifndef
45 | #ifndef YY_PARSER4_DHCP4_PARSER_H_INCLUDED
|
In file included from parser_context.cc:9:
../../../src/bin/dhcp4/parser_context.h:22:1: error: expected unqualified-id before ‘namespace’
22 | namespace isc {
and it goes on further.
What happens is that while generating the parsers, the Kea source files are also compiled. Kea source files depend on parser generated files. Bison doesn't write the entire file at once, it gradually fills it with content. So the parser generated files are fed into the compiler before they are complete. Even if the write to file was atomic, it would still mean that the parser files are potentially too old which would still be incorrect and maybe even pass compilation and result in underterministic behavior.
This is a lack of ordering issue between the parser generated files and the Kea source files.