Dear Debian Sudo Maintainers,
The sudoers parser generation rule in plugins/sudoers/Makefile.in uses
an ordinary multi-target rule:
|$(devdir)/gram.c $(devdir)/gram.h: $(srcdir)/gram.y prologue|
The recipe invokes Bison to generate both parser files. Under parallel
builds, the ordinary multi-target rule may cause the recipe to be
invoked more than once. Duplicate Bison invocations were observed in
build logs. The logs do not establish whether the invocations actually
overlapped, but the shared temporary output files make this a potential
race.
The attached patch changes the rule to a GNU make grouped target:
|$(devdir)/gram.c $(devdir)/gram.h &: $(srcdir)/gram.y prologue|
This ensures that the recipe is run once for the grouped targets.
Grouped explicit targets require GNU make 4.3 or newer.
Testing was performed on Debian 13 (Trixie) with GNU make 4.4.1 and
Bison 3.8.2:
*
Parallel builds with |make -j4|succeeded.
*
Separate test build directories each invoked Bison exactly once.
*
Both generated parser files were present and byte-identical to the
previous generated files.
*
The patch was integrated into the Debian quilt patch series.
*
A complete Debian package build succeeded on a second Debian 13
host, producing version 1.9.16p2-3+deb13u3.
The proposed fix is attached.
Best regards
Marcel Jueling