From owner-freebsd-ports@FreeBSD.ORG Wed May 17 12:38:05 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 1DB4416A53A; Wed, 17 May 2006 12:38:05 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: from syn.atarininja.org (syn.csh.rit.edu [129.21.60.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD1F243D6B; Wed, 17 May 2006 12:38:04 +0000 (GMT) (envelope-from wxs@atarininja.org) Received: by syn.atarininja.org (Postfix, from userid 1001) id BE3CE5C2F; Wed, 17 May 2006 08:39:44 -0500 (EST) Date: Wed, 17 May 2006 08:39:44 -0500 From: Wesley Shields To: Edwin Groothuis , Vasil Dimov , ports@freebsd.org, Paul Koch Message-ID: <20060517133944.GA39615@atarininja.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060517121337.GA50791@iib.unsam.edu.ar> User-Agent: Mutt/1.5.11 Cc: 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 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:38:15 -0000 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. > | > | For example, a dependcy on pkg-config in the directory devel/pkgconfig: > | > | - obtain lock on devel/pkgconfig/Makefile > | - check if pkg-config exists, and if not, build and install it. > | - release lock on devel/pkgconfig/Makefile > | > | > +----] > > Why not > > - check if pkg-config exists and only if it doesn't exist, > try to obtain lock on the lock target. Because at that point aren't you in a race condition? Port A finds out pkg-config doesn't exist. Port B finds out pkg-config doesn't exist. At this point both ports determine they need to build and install the port. 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. You must obtain the lock early on, like Edwin has stated. -- WXS