From owner-freebsd-ports@FreeBSD.ORG Mon May 25 08:10:25 2009 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 BC141106568E; Mon, 25 May 2009 08:10:25 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from mail-ew0-f159.google.com (mail-ew0-f159.google.com [209.85.219.159]) by mx1.freebsd.org (Postfix) with ESMTP id E51348FC1D; Mon, 25 May 2009 08:10:24 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: by ewy3 with SMTP id 3so3050500ewy.43 for ; Mon, 25 May 2009 01:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:organization:to:subject :date:user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=+sh1TN3Is2i4M0A6DFgCVsKquTtqikImfmlgqD97JHs=; b=V9+R32lWddLRs94qFrBJPOlb0t38uSqU+uLytbA5FI8gdihmkxsBa5TDlqRKdFlNOc gRgi2GKJJLZ+ukqNx3AVOx9a2p6GZqVr3WVlX4L1m2IkFNisPqORqA1iJxMvOhFzUBHo Tb6t9/7pVhY82HgRJX2IFMajZKURlhr9puwQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; b=SN2XCLc8/w46zRnS3GKPdK1XkByI7Ne8bWtnJIFeFoG2DtgQDECr0U0snO6/z70ZqJ eZV+/QEdbK6pmeecMTdhjSg3AZ3sLNNAl+RmxPlLEOg4Iy5h4N4AWSEegG2LIB8Di3dk ll8S+t1QFaUZQu8H0W0Tsv39eC6ejxBZevwpc= Received: by 10.216.19.210 with SMTP id n60mr1413792wen.107.1243239024002; Mon, 25 May 2009 01:10:24 -0700 (PDT) Received: from ?0.0.0.0? ([196.34.241.123]) by mx.google.com with ESMTPS id 5sm3828756eyh.40.2009.05.25.01.10.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 25 May 2009 01:10:23 -0700 (PDT) From: David Naylor Organization: Private To: pav@freebsd.org Date: Mon, 25 May 2009 10:11:13 +0200 User-Agent: KMail/1.9.10 References: <20090522.195350.193746535.chat95@mac.com> <200905242007.06917.naylor.b.david@gmail.com> <1243194956.21797.4.camel@hood.oook.cz> In-Reply-To: <1243194956.21797.4.camel@hood.oook.cz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2396821.52uAcJvRMW"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200905251011.16083.naylor.b.david@gmail.com> Cc: pgollucci@p6m7g8.com, Ion-Mihai Tetcu , freebsd-ports@freebsd.org Subject: Re: MAKE_JOBS_UNSAFE (some more ports) 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: Mon, 25 May 2009 08:10:26 -0000 --nextPart2396821.52uAcJvRMW Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 24 May 2009 21:55:56 Pav Lucistnik wrote: > David Naylor p=C3=AD=C5=A1e v ne 24. 05. 2009 v 20:07 +0200: > > On Sunday 24 May 2009 18:27:57 Pav Lucistnik wrote: > > > Ion-Mihai Tetcu p=C3=AD=C5=A1e v ne 24. 05. 2009 v 19:01 +0300: > > > > On Sun, 24 May 2009 16:10:23 +0200 > > > > > > > > Pav Lucistnik wrote: > > > > > Ion-Mihai Tetcu p=C3=AD=C5=A1e v so 23. 05. 2009 v 13:51 +0300: > > > > > > > > - MAKE_JOBS_NUMBER defaults (but user defined) to number of > > > > > > > > cores > > > > > > > > > > > > This part looks OK, I wonder if there's any reason t ain't like > > > > > > this now; Pav? > > > > > > -.if defined(MAKE_JOBS_NUMBER) > > > > > > +MAKE_JOBS_NUMBER?=3D `${SYSCTL} -n kern.smp.cpus` > > > > > > _MAKE_JOBS=3D -j${MAKE_JOBS_NUMBER} > > > > > > -.else > > > > > > -_MAKE_JOBS=3D -j`${SYSCTL} -n kern.smp.cpus` > > > > > > -.endif > > > > > > > > > > Wouldn't that mean an evaluation of the backtick command in every > > > > > make(1) invocation? That would be highly undesirable. > > > > I don't believe that is the case. > > > > Here is what I get with the patch applied (MAKE_JOBS_NUMBER not defined= ): > > /usr/ports/editors/openoffice.org-3# make -V MAKE_JOBS_NUMBER -V > > _MAKE_JOBS `/sbin/sysctl -n kern.smp.cpus` > > -j`/sbin/sysctl -n kern.smp.cpus` > > > > Wouldn't this indicate that the backtick command is not being evaluated? > > Seems correct. But explain again, why you need this change?=20 Not all ports use make but are concurrent capable and require different=20 arguments to be passed which is why I needed to expose MAKE_JOBS_NUMBER=20 (since it is just a number) and why _MAKE_JOBS was not an option. =20 The ooo* ports are an example of this, requiring -P. Some ports may even=20 require multiple arguments to be passed (I do not have an example of that).= =20 > You cannot=20 > use it to evaluate single/multi-processor machine in Makefile, as it's > not expanded there either. To do the checking in a Makefile (in the ooo2 example): =2Einclude =2Eif !defined(NUMOFPROCESSES): NUMOFPROCESSES!=3D echo ${MAKE_JOBS_NUMBER} =2Eendif This example has some problems since MAKE_JOBS_NUMBER is defined in the pos= t=20 section but if it where moved to the pre section then would work. =20 An alternative is to define a variable that would cause MAKE_JOBS_NUMBER to= =20 resolve (but this still requires MAKE_JOBS_NUMBER to be moved to the pre=20 section): =2Eif defined(MAKE_JOBS_RESOLVE) =2Eif !defined(MAKE_JOBS_NUMBER) MAKE_JOBS_NUMBER!=3D ${SYSCTL} -n kern.smk.cpus =2Eendif =2Eelse MAKE_JOBS_NUMBER?=3D `${SYSCTL} -n kern.smk.cpus` =2Eendif _MAKE_JOBS=3D -j${MAKE_JOBS_NUMBER} > And why should anything fail with -j1 but work with -j4? That is totally > unexpected. I agree but the ports exist. ooo2 is an example that handles the two cases= =20 differently, also see (about halfway down)=20 http://lists.freebsd.org/pipermail/freebsd-ports/2009-May/054777.html. =20 --nextPart2396821.52uAcJvRMW Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEABECAAYFAkoaUqQACgkQUaaFgP9pFrJPywCfSnxf0RAEbsyeNDwKFGVwP13I xOcAn0ONi/RSY6fLjazdfcfitRjZxnoK =7JzY -----END PGP SIGNATURE----- --nextPart2396821.52uAcJvRMW--