From owner-freebsd-ports@FreeBSD.ORG Wed May 17 06:00:39 2006 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A3BFF16A404; Wed, 17 May 2006 06:00:39 +0000 (UTC) (envelope-from vd@datamax.bg) Received: from jengal.datamax.bg (jengal.datamax.bg [82.103.104.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 61B0943D48; Wed, 17 May 2006 06:00:28 +0000 (GMT) (envelope-from vd@datamax.bg) Received: from qlovarnika.bg.datamax (qlovarnika.bg.datamax [192.168.10.2]) by jengal.datamax.bg (Postfix) with SMTP id 44BB0B859; Wed, 17 May 2006 09:00:27 +0300 (EEST) Received: (nullmailer pid 41327 invoked by uid 1002); Wed, 17 May 2006 06:00:27 -0000 Date: Wed, 17 May 2006 09:00:26 +0300 From: Vasil Dimov To: Paul Koch Message-ID: <20060517060026.GA40653@qlovarnika.bg.datamax> References: <200605171353.37745.paul.koch@statseeker.com> <20060517045403.GI1113@k7.mavetju> <200605171508.07228.paul.koch@statseeker.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <200605171508.07228.paul.koch@statseeker.com> X-OS: FreeBSD 6.1-STABLE User-Agent: Mutt/1.5.11 Cc: ports@freebsd.org, Edwin Groothuis Subject: Re: Is it safe to compile multiple ports at the same time ? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vd@FreeBSD.org List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 May 2006 06:00:39 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 17, 2006 at 03:08:07PM +1000, Paul Koch wrote: > On Wed, 17 May 2006 02:54 pm, Edwin Groothuis wrote: > > On Wed, May 17, 2006 at 01:53:37PM +1000, Paul Koch wrote: > > > Is it safe to compile multiple ports at the same time and not get > > > the makes to run into each other when building dependency ports ? > > > > I once submitted a patch which checked for this. Now that I've > > learned about lockf(1) I think there is a chance a next one will > > be approved too! > > > > Edwin >=20 > So.... it would be nice to have some type of locking in the ports build. = =20 > For example, when a make enters /usr/ports/{category}/{port}, it gets=20 > an exclusive lock on that port (maybe on the Makefile itself, or a=20 > specific lock file) before it attempts to build/install the port. It=20 > could be done by using lockf, but that just forks more processes, and=20 > there are already lots of them. I'd dare to say.... maybe it could be a= =20 > function of make itself. As in, extend make so it understands a new=20 > keyword that makes it get an exclusive lock, using flock(2). =20 >=20 > With locking, you should then be able to fire off lots of port builds=20 > and use up all those cpu cores :) >=20 Not really, locking will just prevent breakages. Let me illustrate my thought with an example: port A depends on X port B depends on X You start building A which results in building X via exclusive lock on X. During the build of X you decide to build B which results in building X (X is not yet installed) but you block trying to acquire the exclusive lock on X so you wait _idling_ until building of X is done. Furthermore what do you suggest to do when the lock is released? Ofcourse if B depends also on Y it can fallback to building Y if it cannot gain exclusive lock on X. --=20 Vasil Dimov gro.DSBeerF@dv Testing can show the presence of bugs, but not their absence. -- Edsger W. Dijkstra --opJtzjQTFsWo+cga Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQFEarv6Fw6SP/bBpCARAhUmAKDPZ0G9mp2qObPpXLX9N+Qg0psXwACdGqTI 8zELyZKIrJB4eDq4w41fMKQ= =aUG9 -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga--