Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Apr 2009 18:12:34 -0700
From:      Jeremy Lea <reg@FreeBSD.ORG>
To:        David Forsythe <dforsyth@FreeBSD.ORG>
Cc:        pav@FreeBSD.ORG, freebsd-ports@FreeBSD.ORG
Subject:   Re: Parallel builds, build locks, pkg_dbdir locked
Message-ID:  <20090410011234.GA20765@flint.openpave.org>
In-Reply-To: <dfaab3f70904021457u5b6faccbx373313dfecf2e6ae@mail.gmail.com>
References:  <dfaab3f70904021457u5b6faccbx373313dfecf2e6ae@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090410011234.GA20765>