Subject: Re: patches to fix make -j
To: James Chacon <jmc@netbsd.org>
From: Todd Vierling <tv@duh.org>
List: tech-toolchain
Date: 12/17/2003 17:55:49
James Chacon wrote:

: Unless your Makefiles have been tuned for -j it's likely to break as -j
: means dependencies can be built in any order. So without .WAIT's in
: correct places it's unlikely to "do the right thing" in a lot of cases.

...which isn't exactly true...

.WAIT was mainly introduced as a way to make dependency trees, particularly
those generated by <bsd.subdir.mk>, easier to implement in the presence of
parallelism.  .WAIT is, and will always be, an ugly hack.

It actually causes more issues than it solves, because use of .WAIT has
eliminated the "all-foo: all-bar" dependencies that were once in Makefiles
using <bsd.subdir.mk>, thus reducing the usable amount of -j concurrency --
and making it impossible to do a "make all-foo" and get its dependencies
built automatically.  It also hides knowledge of target dependencies from
someone who's new to the code.

Proper Makefile dependency ordering has zero need for .WAIT and will work
properly under -j (provided -j works as advertised).  At the time .WAIT was
being sprinkled all over the place, I offered to fix <bsd.subdir.mk> to
allow for specification of dependency ordering as an alternative to .WAIT,
but no one seemed to care.

-- 
-- Todd Vierling <tv@duh.org> <tv@pobox.com>