From owner-freebsd-ports@FreeBSD.ORG Wed May 17 14:43:13 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 8294116A8BF for ; Wed, 17 May 2006 14:43:13 +0000 (UTC) (envelope-from paul.koch@statseeker.com) Received: from wally.statseeker.com (wally.statscout.com [203.39.101.146]) by mx1.FreeBSD.org (Postfix) with ESMTP id 621BD43D62 for ; Wed, 17 May 2006 14:43:07 +0000 (GMT) (envelope-from paul.koch@statseeker.com) Received: from localhost (localhost [127.0.0.1]) by wally.statseeker.com (8.13.3/8.13.3) with ESMTP id k4HEh61J042768; Thu, 18 May 2006 00:43:06 +1000 (EST) (envelope-from paul.koch@statseeker.com) Received: from wally.statseeker.com ([127.0.0.1]) by localhost (wally.statseeker.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 42394-06; Thu, 18 May 2006 00:42:50 +1000 (EST) Received: from speedy (CPE-203-51-255-173.qld.bigpond.net.au [203.51.255.173]) (authenticated bits=0) by wally.statseeker.com (8.13.3/8.13.3) with ESMTP id k4HEglOK042763 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Thu, 18 May 2006 00:42:48 +1000 (EST) (envelope-from paul.koch@statseeker.com) From: Paul Koch To: ports@freebsd.org, Vivek Khera Date: Thu, 18 May 2006 00:42:41 +1000 User-Agent: KMail/1.8 References: <200605171353.37745.paul.koch@statseeker.com> <20060517060026.GA40653@qlovarnika.bg.datamax> <66F2413E-5D81-4BD6-B842-104A449E4753@khera.org> In-Reply-To: <66F2413E-5D81-4BD6-B842-104A449E4753@khera.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605180042.42413.paul.koch@statseeker.com> X-Virus-Scanned: amavisd-new at statseeker.com 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 Reply-To: paul.koch@statseeker.com List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 May 2006 14:43:15 -0000 On Wed, 17 May 2006 11:50 pm, Vivek Khera wrote: > On May 17, 2006, at 2:00 AM, Vasil Dimov wrote: > > Ofcourse if B depends also on Y it can fallback to building Y if it > > cannot gain exclusive lock on X. > > If you do that, then you get a lock on Y, which may also happen to be > a dependency of X, and now you have deadlock. > > You also need to ensure that all ports specify dependencies in the > same order (or at least take the locks in the same order) else you > will deadlock at some point if you allow the port to take more than > one lock at a time. Yer, it could get very complex if you allowed it to go onto another dependency port. Best to keep it simple and just block waiting for the lock on X. I assume there will never be some type of circular dependencies in the ports either. My original thinking was just a simple locking setup, because I often setup new machines by doing a release install, cvsup to -stable and ports, build/install world/kernel, xorg, kde, openoffice, gvim, browers, etc... and have to do them one at a time instead of firing up lots of port builds and coming back a few days later :) I was wondering if the locking mechanism should be added as a standard bit of functionality to "make". I am surprised it doesn't have it already. For example, add another reserved keyword like "LOCK" or ".LOCK", and if it is set in the makefile, or one of its included files (eg. bsd.ports.whatever) then it gets an exclusive lock. Maybe even be verbose about it - try getting a non-blocking lock and if it fails then print a message and go for a blocking lock. Just a thought. Paul.