usr/src/cmd/sgs/Makefile not quite correct after 8413
When upstreaming Joyent OS-6188, a slight change was requested during review to usr/src/cmd/sgs/Makefile. However the change was slightly incorrect. The .PARALLEL pseudo-target actually implies those dependent targets can be made in parallel with other targets -- a subtle distinction from in parallel with other .PARALLEL targets. The dmake(1) man page is not very clear on this point. Many of the $(MSGSUBDIRS) targets are also listed in .PARALLEL (though through a different macro expansion, further making it less obvious).
The lines in question are:
$(MSGDIR): native-add _msg_sgsmsg: $(MSGDIR) ... $(MSGDIR): $(MSGSUBDIRS) ...
The effective dependency list for $(MSGDIR) is then 'native-add $(MSGSUBDIRS)'. Since many of the expanded values of $(MSGSUBDIRS) are also listed with .PARALLEL, it will try to build those in parallel with native-add. As many of these subdirs require sgsmsg from sgs/tools, they will fail if dmake gets too aggressive in it's parallelism.
Updated by Jason King over 2 years ago
To illustrate the issue, this simple makefile (when run with dmake and DMAKE_MAX_JOBS (or -j) > 1) shows it will start to build the .PARALLEL targets at the same time it tries to build 'b':
.PARALLEL: c d e f a: b c d e f echo a sleep 10 b: FRC echo b sleep 10 c: FRC echo c sleep 10 d: FRC echo d sleep 10 e: FRC echo e sleep 10 f: FRC echo f sleep 10 FRC:
Updated by Electric Monk over 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 2ec538a056d6d1e4285fb12d3921883339b6a1d0 Author: Jason King <firstname.lastname@example.org> Date: 2017-07-12T00:33:29.000Z 8482 usr/src/cmd/sgs/Makefile not quite correct after 8413 Reviewed by: Andy Stormont <email@example.com> Reviewed by: Igor Kozhukhov <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>