Bug 63942

Summary: Regeneration of util_expr parser is not parallel-make safe
Product: Apache httpd-2 Reporter: Joe Orton <jorton>
Component: BuildAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Joe Orton 2019-11-20 09:02:04 UTC
Found from a travis build failure -

https://api.travis-ci.org/v3/job/613990109/log.txt

The rules to regenerate util_expr_scan.c util_expr_parse.c util_expr_parse.h from util_expr_parse.y are not parallel-safe since "make -j2" will potentially run the rule multiple times in parallel, and the rule uses the outputs as intermediate files which are modified in-place.

This could potentially be fixed by using unique filenames per invocation (e.g. with mktemp or similar) though since these files are almost never regenerated it is possibly not worth the effort.
Comment 1 Joe Orton 2019-11-20 10:37:09 UTC
To repro, e.g.

 $ cd server
 $ rm -f util_expr_parse.[ch] util_expr_scan.c
 $ make -j2

if the build works you're lucky, but you'll see bison, flex etc are invoked twice.