Number of make jobs for bootcycle-images target (original) (raw)

Erik Joelsson erik.joelsson at oracle.com
Tue Apr 4 13:10:58 UTC 2017


Hello,

On 2017-04-04 14:59, Magnus Ihse Bursie wrote:

What is the intention here? You want build the second part of the boot cycle build without setting -j? Is this because we already have a good value of -j inherited from an earlier make call? We only want to set the -j flag once since resetting it in a sub make call causes us to loose the job server. If there was some other way of detecting that we are in a wrapped call, that would certainly help. The fix looks scary, but that's maybe because all of this make-wrapping logic is scary.

What if you keep sending JOBS= and then check if JOBS has a value in Init.gmk, instead of introducing DISABLEJOBS? I considered that, but then we lose the currently valid empty value for JOBS, which today translates to -j without argument. One could argue that it's rarely a good idea to let make just go crazy with processes though and in that case we can choose to interpret JOBS="" as don't set -j at all.

/Erik

/Magnus

On 2017-04-04 14:19, Erik Joelsson wrote: Hello Alex,

It wasn't a typo, but it was also not correct, as you are pointing out. Setting JOBS to $(JOBS) would disable the jobserver for the sub make process and also risk flooding a smaller system. What we really need is a way to block the setting of -j in the "Init.gmk main" target. Something like this seems to work for me:

diff -r 7810f75d016a make/Init.gmk --- a/make/Init.gmk +++ b/make/Init.gmk @@ -303,7 +303,8 @@ $(call PrepareSmartJavac) _( cd $(TOPDIR) && _ _$(NICE) (MAKE)(MAKE) (MAKE)(MAKEARGS) $(OUTPUTSYNCFLAG) _ _- -j (JOBS)−fmake/Main.gmk(JOBS) -f make/Main.gmk (JOBS)fmake/Main.gmk(USERMAKEVARS) _ _+ (if(if (if(DISABLEJOBS),, -j $(JOBS)) _ _+ -f make/Main.gmk $(USERMAKEVARS) _ $(PARALLELTARGETS) $(COMPAREBUILDMAKE) _$(BUILDLOGPIPE) || _ _( exitcode=$$? && _ $(PRINTF) "\nERROR: Build failed for _$(TARGETDESCRIPTION) (exit code exitcode) \n" _ diff -r 7810f75d016a make/Main.gmk --- a/make/Main.gmk +++ b/make/Main.gmk @@ -320,7 +320,7 @@ ifneq ($(COMPILETYPE), cross) $(call LogWarn, Boot cycle build step 2: Building a new JDK image using previously built image) +$(MAKE) (MAKEARGS)−f(MAKEARGS) -f (MAKEARGS)f(SRCROOT)/make/Init.gmk _PARALLELTARGETS=$(BOOTCYCLETARGET) _ - JOBS= SPEC=$(dir $(SPEC))bootcycle-spec.gmk main + DISABLEJOBS=true SPEC=$(dir $(SPEC))bootcycle-spec.gmk main else $(call LogWarn, Boot cycle build disabled when cross compiling) endif /Erik On 2017-04-04 13:26, Alex Kashchenko wrote: Hi, Currently in jdk9 bootcycle-images make target is executed with unlimited number of make jobs. May I ask whether "JOBS=" bit here [1] is intentional or just a typo and should be "JOBS=$(JOBS)" instead? Current variant works on x8664 but crashes with native arm32 boot cycle builds - compilation tasks are spawned faster than being executed.

[1] http://hg.openjdk.java.net/jdk9/jdk9/file/41d9f0545d53/make/Main.gmk#l323



More information about the build-dev mailing list