Replacing JOBS=x with -j for make parallelism did not work

Kelly O'Hair kelly.ohair at oracle.com
Tue May 29 09:53:14 PDT 2012


On May 29, 2012, at 3:39 AM, Magnus Ihse Bursie wrote:

> On 04/26/12 14:43, magnus.ihse.bursie at oracle.com wrote:
>>> Changeset: 33eaa832ce5e
>>> Author:    ihse
>>> Date:      2012-04-26 14:43 +0200
>>> URL:       http://hg.openjdk.java.net/build-infra/jdk8/rev/33eaa832ce5e
>>> 
>>> Replace previous fix (JOBS=) with a solution that actually respects -j if
>>> set on top-level Makefile.
> 
> Unfortunately, it turned out that this fix does not really work. :-(

> 
> If you run "make -j2", it works well. That was my test case, when doing the fix. However, when you run "make -j1", it does not -- this case is indistinguishable from just "make". Unfortunately, it is also one of the typical cases for wanting to override -j, to force non-parallel execution.
> 
> I can see a a bunch of possible solutions, none of them really optimal:
> 
> 1) Restore the previous fix with JOBS=x
> 
> 2) Really extract the actual make command line using ugly hacks (like some shell script magic and reading from /proc). Might be hard to get it properly working on all platforms.
> 
> 3) Support a combination, so that both "make -j2" and "make JOBS=2" works, but if you want singlethreaded execution, you *must* specify "make JOBS=1".
> 
> Out of these, I'd prefer 1). Anyone else has an opinion?

In my opinion, even with 1 core, we should always use a setting of 2.  So 2 should be our default unless we know
we can set it higher.

Anyone wanting non-parallel execution would be someone trying to debug some kind of build problem (debugging the makefiles)
or he/she is using a severely underpowered system, which I don't think we want to encourage.
So if those few people have to say JOBS=1,  to get non-parallel operation, that's fine with me. Or maybe VERY_SLOW=true. ;^)

So I'd say 3)  if I understand this all correctly.

-kto

> 
> /Magnus




More information about the build-infra-dev mailing list