Is it safe to compile multiple ports at the same time ?

Fernan Aguero fernan at iib.unsam.edu.ar
Wed May 17 12:31:10 UTC 2006


+----[ Paul Koch <paul.koch at statseeker.com> (17.May.2006 03:21):
|
| > 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.
| 
| Yes, breakage is the main problem.
| 
| When the lock is released, then the second make will immediately see 
| work/.build_done.XXXXXXX is present ??, 

maybe, provided the other build process didn't clean
everything after itself (ie. make clean)

but alternatively it could check /var/db/pkg if the
requirement is for the dependency to be installed.

And now that we're here ... are there any ports that depend
on another port to be built but not installed (ie to link
against something in WRKSRC?) ... this could provide a nice
test case ... do you check work/.build_done*? /var/db/pkg? 

Suppose this situation:

as part of the build process for A, port X gets locked
(building of X starts).

now port B, that also depends on X (but needs to access
WRKSRC) fails to get a lock on X, and sits waiting ... how
can we prevent that the 'clean' target of port X gets called
(even if it was specified)? We don't care? OK, so perhaps
the user knows what he's doing and doesn't do a 'make clean'
if he's launching several port builds ...


|then return successfully to the 
| make which called it.  I haven't looked to see how it works under the 
| hood though.
| 
| Yep, in your example above, it won't be any faster.  But what if I want 
| to do something like:
| 
|  port A depends on  Q R S T X
|  port B depends on  D E F G X
| 
| then lots of simultaneous building can occur until they both hit port X.
|
+----]

Yes, this is one of the benefits of the locking strategy.

This, together with the safety benefit of knowing that the
WRKSRC of a build in progress won't be nuked when you do a
'make clean' in a separate port are the two main reasons why
this is a yes/yes for the ports system. IMO

Fernan


More information about the freebsd-ports mailing list