Parallel builds, build locks, pkg_dbdir locked

Jeremy Lea reg at FreeBSD.ORG
Thu Apr 9 18:40:21 PDT 2009


Hi,

On Thu, Apr 02, 2009 at 05:57:05PM -0400, David Forsythe wrote:
> patch: http://dmz2.khome.utcorp.net/~dforsyth/port.mk-locks.diff

Since no one else seems to have commented, a few quick thoughts.  I have
not actually tried your patch.

1. Is there any reason not to do the locking?  Removing NO_LOCKS would
make things much simpler.  Would it be possible to not lock the whole
initial make call and only lock the main targets (grep for USE_SUBMAKE).

2. The locks seem to be created in ${PORTSDIR}/${PKGORIGIN}, which might
be read only.  The locks should be created in ${PORT_DBDIR}.  Or use
${PORTSDIR}/${PKGORIGIN}/Makefile and make lockf always keep the file!

3. I don't see how parallel fetching is useful.  If you've got enough
bandwidth to make it work, then you've got enough bandwidth to be
considered rude to the FTP site at the receiving end.  If you haven't
then you're not going to benefit from multiple fetches.  For checksums,
you also don't want to stress your disks with parallel reads.

4. Use:
.if defined(MAX_PARALLEL_DEPENDS) && ${MAX_PARALLEL_DEPENDS} != "1"
_P_DEPENDS = -j ${MAX_PARALLEL_DEPENDS}
.endif
Forcing BATCH is bad.  It changes how some ports work.  Rather, it would
be better to force a config-recursive if someone wants this.

5. Can you use "${MAKE} -C $DIR ..." instead of "${SH} -c {cd ${DIR} &&
$MAKE ...}" as an argument for ${LOCKF}

6. It is not clear to me that all of the merging of lib-depends into the
other depends targets buys you anything.  I don't think it allows you to
run the different types of depends targets in parallel?  The logic of
parallel depends would be cleaner if you just defined all of the
individual targets for each depends type in one loop, the lib depends in
second loop, and built the locking targets and things a third loop.  Not
changing the whitespace or changing $$i to $${dependency} would be good,
because they would make the patch easier to read.

7. The locking for PKGDIR is different to the other locking, and
probably should always be done.  You could wrap the entire target into
the ${SH} call.  Do you need to wrap the PKG_INFO command in a lockf
call?

Otherwise, thank you for working on this important feature!  I often try
to launch multiple port builds in different terminals and hate it when
they crash...

Regards,
  -Jeremy

-- 
FreeBSD - Because the best things in life are free...
                                           http://www.freebsd.org/


More information about the freebsd-ports mailing list