Skip site navigation (1)Skip section navigation (2)
Date:      27 Mar 2002 00:21:31 +0200
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        Maxim Sobolev <sobomax@FreeBSD.org>
Cc:        Akinori MUSHA <knu@iDaemons.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: ports/Mk bsd.port.mk
Message-ID:  <1017181296.3416.12.camel@notebook>
In-Reply-To: <3CA0C925.BB1D183E@FreeBSD.org>
References:  <200203250848.g2P8mlf77991@freefall.freebsd.org> <86d6xrgnm2.wl@archon.local.idaemons.org>  <3CA0C925.BB1D183E@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-zjqtqNwSEYfhfeIRIRrQ
Content-Type: multipart/mixed; boundary="=-XKT3wbbEJ/A8YUN1LeQP"


--=-XKT3wbbEJ/A8YUN1LeQP
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2002-03-26 at 21:16, Maxim Sobolev wrote:
> Akinori MUSHA wrote:
> >=20
> > At Mon, 25 Mar 2002 00:48:47 -0800 (PST),
> > sobomax wrote:
> > > sobomax     2002/03/25 00:48:47 PST
> > >
> > >   Modified files:
> > >     Mk                   bsd.port.mk
> > >   Log:
> > >   - Significantly reduce overhead associated with bsd.port.mk by repl=
acing .USE
> > >     macro, which was invoking separate make(1) process for each of th=
e main
> > >     targets, with explicit make(1) targets and specifying the depende=
ncies on
> > >     those targets in normal Makefile way. This gives up to 4x speedup=
. For the
> > >     ports relying on the old functionality (i.e. each main target in =
a separate
> > >     make(1) process) provide a USE_SUBMAKE knob, which provides old b=
ehaviour;
> > >
> > >   - speed-up dependency registration process by the factor of two, wh=
ich
> > >     could be a great win especially for things like GNOME and KDE wit=
h very long
> > >     dependency chains;
> > >
> > >   - clean-up internal structure of the file, so that it is easier to =
understand
> > >     and extend it when necessary.
> >=20
> > While the performance increase is really great, I found a problem
> > which violates POLA where you can no longer make multiple targets in
> > one invocation of make(1).  For example, `make clean build' does not
> > work as expected, and something like `make reinstall package clean'
> > seems to fail sometimes, although I don't know if it depends on the
> > port's dependencies or on the state of the ports' working directories
> > (cookie files).
> >=20
> > So, unless this is a trivial bug you just missed which can be fixed
> > shortly, I think you'd better back the change out for the moment
> > pending investigation and solution because 5.0-DP1 is coming soon and
> > we don't have enough time to make sure we get all the ports and
> > scripts happy.
>=20
> Thank you for the information. I'll look into the problem later today
> and if there is no trivial fix then tomorrow I'll backout my change
> temporarly until the proper sulution is worked out.

Hmm, difficult one. make(1) really isn't intended to be used like that -
it lacks some features necessary for making "cookie" idea easy to
implement without spawning child make processes. However, I worked out a
patch, which should close the issue in question. Please test it and let
me know if it works for you, because I want to commit it tomorrow.

Thank you!

-Maxim

--=-XKT3wbbEJ/A8YUN1LeQP
Content-Disposition: attachment; filename=bsd.port.mk.fix
Content-Type: text/plain; name=bsd.port.mk.fix; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

--- bsd.port.mk	2002/03/26 20:30:26	1.13
+++ bsd.port.mk	2002/03/26 22:00:34
@@ -2524,8 +2524,12 @@
 ${${target:U}_COOKIE}: ${_${target:U}_SEQ}
 	@${TOUCH} ${TOUCH_FLAGS} ${.TARGET}
 .else
-${${target:U}_COOKIE}:
-	${DO_NADA}
+${${target:U}_COOKIE}::
+	@if [ -e ${.TARGET} ]; then \
+		${DO_NADA}; \
+	else \
+		cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.TARGET}; \
+	fi
 .endif
=20
 .endfor

--=-XKT3wbbEJ/A8YUN1LeQP--

--=-zjqtqNwSEYfhfeIRIRrQ
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQA8oPRroNu5t4iCBa8RAkF0AJ9ZPuW5gqkUJ0axHuik0K3nNbL1HACfbTX/
vwLXpG25Z4uCGa+/n7oIRC4=
=Tb3O
-----END PGP SIGNATURE-----

--=-zjqtqNwSEYfhfeIRIRrQ--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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