From owner-freebsd-ports@FreeBSD.ORG Wed May 17 12:53:11 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 4A23616A436; Wed, 17 May 2006 12:53:11 +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 A884243D45; Wed, 17 May 2006 12:53:10 +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 8DBBDB833; Wed, 17 May 2006 15:53:09 +0300 (EEST) Received: (nullmailer pid 1296 invoked by uid 1002); Wed, 17 May 2006 12:53:09 -0000 Date: Wed, 17 May 2006 15:53:09 +0300 From: Vasil Dimov To: Wesley Shields Message-ID: <20060517125309.GA1265@qlovarnika.bg.datamax> References: <200605171353.37745.paul.koch@statseeker.com> <20060517045403.GI1113@k7.mavetju> <200605171508.07228.paul.koch@statseeker.com> <20060517060026.GA40653@qlovarnika.bg.datamax> <20060517061302.GR1116@k7.mavetju> <20060517121337.GA50791@iib.unsam.edu.ar> <20060517133944.GA39615@atarininja.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline In-Reply-To: <20060517133944.GA39615@atarininja.org> X-OS: FreeBSD 6.1-STABLE User-Agent: Mutt/1.5.11 Cc: ports@freebsd.org, Edwin Groothuis , Paul Koch 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 12:53:11 -0000 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 17, 2006 at 08:39:44AM -0500, Wesley Shields wrote: > On Wed, May 17, 2006 at 09:13:37AM -0300, Fernan Aguero wrote: > > +----[ Edwin Groothuis (17.May.2006 03:16): > > | > > | You have to obtain a lock on the X's Makefile before you are doing > > | to check if you have this port installed. > > |=20 > > | For example, a dependcy on pkg-config in the directory devel/pkgconfi= g: > > |=20 > > | - obtain lock on devel/pkgconfig/Makefile > > | - check if pkg-config exists, and if not, build and install it. > > | - release lock on devel/pkgconfig/Makefile > > |=20 > > | > > +----] > >=20 > > Why not > >=20 > > - check if pkg-config exists and only if it doesn't exist, > > try to obtain lock on the lock target. >=20 > Because at that point aren't you in a race condition? >=20 > Port A finds out pkg-config doesn't exist. > Port B finds out pkg-config doesn't exist. >=20 > At this point both ports determine they need to build and install the > port. >=20 > Port B manages to obtain the lock first, and builds and installs > pkgconfig. > Port A waits on Port B to finish. > Upon finishing Port A obtains the lock and builds and attempts to > install an already installed port. >=20 > You must obtain the lock early on, like Edwin has stated. >=20 Maybe he meant - check if pkg-config exists and only if it doesn't exist, try to obtain lock on the lock target. - check if pkg-config exists, and if not, build and install it. - release lock on devel/pkgconfig/Makefile this will eventually save unnecessary locking with the cost of checking twice if the port is installed. --=20 Vasil Dimov gro.DSBeerF@dv Testing can show the presence of bugs, but not their absence. -- Edsger W. Dijkstra --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQFEaxy1Fw6SP/bBpCARAq+pAJ0SnFCFv0W7g5w+2nYh+5jV8wx19gCg2I3T Bgd6YWsBKUccC1FJxdg4uVo= =+Yh/ -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--