From owner-freebsd-ports@FreeBSD.ORG Sat Aug 28 19:09:40 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 188AF10656A9 for ; Sat, 28 Aug 2010 19:09:40 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (gerbercreations.com [71.39.140.16]) by mx1.freebsd.org (Postfix) with ESMTP id AAD2E8FC1C for ; Sat, 28 Aug 2010 19:09:39 +0000 (UTC) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.14.4/8.14.4) with ESMTP id o7SIeIHT078302; Sat, 28 Aug 2010 11:40:18 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.14.4/8.14.4/Submit) id o7SIeHcP078301; Sat, 28 Aug 2010 11:40:17 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Sat, 28 Aug 2010 11:40:17 -0700 From: Greg Lewis To: David Naylor Message-ID: <20100828184017.GA78278@misty.eyesbeyond.com> References: <201006251808.29467.naylor.b.david@gmail.com> <861vazh881.fsf@gmail.com> <8662z58gid.fsf@gmail.com> <201008281428.06609.naylor.b.david@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline In-Reply-To: <201008281428.06609.naylor.b.david@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Anonymous , Greg Lewis , freebsd-ports@freebsd.org Subject: Re: MAKE_JOBS and openjdk6 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 19:09:40 -0000 --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Aug 28, 2010 at 02:28:02PM +0200, David Naylor wrote: > On Friday 20 August 2010 17:12:42 Anonymous wrote: > > Anonymous writes: > > > David Naylor writes: > > >>> %% > > >>> Index: java/openjdk6/Makefile > > >>> > > >>> @@ -266,3 +267,6 @@ post-install: > > >>> @${CAT} ${PKGMESSAGE} > > >>> > > >>> .include > > >>> > > >>> + > > >>> +# XXX: use `?=' in bsd.port.mk > > >>> +_MAKE_JOBS= > > >>> %% > > >> > > >> Yes, I prefer this approach. See attached for the patch that does this. > > >> I will file a PR about this shortly. > > > > > > I've filed ports/148754 about defining empty _MAKE_JOBS so it's not > > > forgotten. > > > > That PR was recently committed. So, you can try to resurrect ports/148753. > > I've had a look at openjdk6 and it appears it really is MAKE_JOBS_UNSAFE. > There are portions of it that are able to use make jobs and those are compiled > using HOTSPOT_BUILD_JOBS. > > I suggest that either: > - openjdk stops using HOTSPOT_BUILD_JOBS and declares itself unsafe, or It has already declared itself unsafe. > - declare itself make jobs safe and use HOTSPOT_BUILD_JOBS for those parts > that can use it > > Attached is a patch that achieves the latter suggestion. > > The problem with the port as it stands now is that it breaks with > FORCE_MAKE_JOBS, does not honour MAKE_JOBS_NUMBER and that it will consume a > lot of resources when building, more so than what is reasonably expected. > Simply declaring the port make jobs unsafe does not fix the resource > consumption that some programs/scripts may take into account. > > Taking the first option will result in slower build times when the port is able > to build faster. > > Taking the second option results in overriding a 'private' variable. There is > precedent in ports for using that 'private' variable. With the recently > committed changes using the 'private' variable is less intrusive. > > I recommend the second option. It allows the port to build as fast as > possible, to honour MAKE_JOBS_NUMBER and does not employ any hacks. I would argue that overriding a private variable is a hack (other ports doing it doesn't make it not a hack). Alternative patch attached which seems to achieve the same result from my perspective without overriding _MAKE_JOBS. > diff -ur /usr/ports/java/openjdk6/Makefile openjdk6/Makefile > --- /usr/ports/java/openjdk6/Makefile 2010-07-15 22:29:26.000000000 +0200 > +++ openjdk6/Makefile 2010-07-15 22:33:45.000000000 +0200 > @@ -48,6 +48,7 @@ > > # java extracts directly to the cwd > WRKSRC= ${WRKDIR} > +MAKE_JOBS_SAFE= yes > > USE_GMAKE= yes > USE_MOTIF= yes > @@ -145,8 +146,10 @@ > USE_DISPLAY= yes > .endif > > -BUILD_JOBS_NUMBER!= ${SYSCTL} -n kern.smp.cpus > -MAKE_ENV+= HOTSPOT_BUILD_JOBS=${BUILD_JOBS_NUMBER} > +.if !defined(DISABLE_MAKE_JOBS) > +MAKE_ENV+= HOTSPOT_BUILD_JOBS=${MAKE_JOBS_NUMBER} > +_MAKE_JOBS= > +.endif > > COPYDIRS= \ > hotspot/src/os/linux/launcher \ -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org --qMm9M+Fa2AknHoGS Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="Makefile.diff" Index: Makefile =================================================================== RCS file: /var/fcvs/ports/java/openjdk6/Makefile,v retrieving revision 1.28 diff -u -r1.28 Makefile --- Makefile 15 Aug 2010 05:23:06 -0000 1.28 +++ Makefile 28 Aug 2010 18:27:44 -0000 @@ -147,8 +147,14 @@ USE_DISPLAY= yes .endif -BUILD_JOBS_NUMBER!= ${SYSCTL} -n kern.smp.cpus +.if !defined(DISABLE_MAKE_JOBS) +.if defined(MAKE_JOBS_NUMBER) +BUILD_JOBS_NUMBER= ${MAKE_JOBS_NUMBER} +.else +BUILD_JOBS_NUMBER= `${SYSCTL} -n kern.smp.cpus` +.endif MAKE_ENV+= HOTSPOT_BUILD_JOBS=${BUILD_JOBS_NUMBER} +.endif COPYDIRS= \ hotspot/src/os/linux/launcher \ --qMm9M+Fa2AknHoGS--