[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: make: should -j affect cwd?
On Sat, Jan 14, 2012 at 10:08:11PM -0500, James K. Lowden wrote:
> It seems make(1) does or does not retain the effect of cd(1) between
> commands depending on whether or not the -j option is used. This
> behavior is not documented. Is it expected?
It is known; I'm not sure I'd say it's expected.
The problem is that -j turns on an entirely different set of code
paths that handle many things differently. 20+ years ago when make was
written, it was assumed that anyone who wanted to be parallelizing
would be using custom makefiles written for the purpose, and so it was
ok to behave differently, whereas "compat" mode was meant to be able
to handle (some) off the shelf makefiles.
Exit Sprite and enter 8-way machines selling at Walmart and none of
this logic makes sense any more. It is really highly undesirable for
"make" and "make -j1" to do totally different things. We need to
either dump compat mode entirely, or bring the -j behavior into line
with the way compat mode works, or sort out the code so that
parallelism and compat mode are independent concepts. Because the guts
of make are horribly bodgy, none of these is a trivial undertaking,
least of all the third; but both the first and the second have
And so because there's no clear path to take, nothing happens...
The best approach for the time being is to just patch the offending
makefile(s) like this:
- cd foo && bar
+ (cd foo && bar)
A substantial number of 3rd-party makefiles are already written this
David A. Holland
Main Index |
Thread Index |