Is it safe to compile multiple ports at the same time ?
Paul Koch
paul.koch at statseeker.com
Wed May 17 14:43:15 UTC 2006
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.
More information about the freebsd-ports
mailing list