From owner-svn-src-head@freebsd.org Fri Sep 9 18:29:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DAC0BD45FC; Fri, 9 Sep 2016 18:29:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 35B4B7A0; Fri, 9 Sep 2016 18:29:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 2453A1F94; Fri, 9 Sep 2016 18:29:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E1750240FF; Fri, 9 Sep 2016 18:29:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id A26aTxo4KfbC; Fri, 9 Sep 2016 18:29:18 +0000 (UTC) Subject: Re: svn commit: r305634 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com B16FE240F6 To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201609090121.u891LZOO023156@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Fri, 9 Sep 2016 11:29:16 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <201609090121.u891LZOO023156@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="b2LLHF3rXQuC7goSJGUI0wKvg1qFKiJC4" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2016 18:29:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --b2LLHF3rXQuC7goSJGUI0wKvg1qFKiJC4 Content-Type: multipart/mixed; boundary="kdxOXeX0WTFb1VliHB6D3XS12MGCssu1X"; protected-headers="v1" From: Bryan Drewery To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r305634 - head/share/mk References: <201609090121.u891LZOO023156@repo.freebsd.org> In-Reply-To: <201609090121.u891LZOO023156@repo.freebsd.org> --kdxOXeX0WTFb1VliHB6D3XS12MGCssu1X Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 9/8/16 6:21 PM, Simon J. Gerraty wrote: > Author: sjg > Date: Fri Sep 9 01:21:35 2016 > New Revision: 305634 > URL: https://svnweb.freebsd.org/changeset/base/305634 >=20 > Log: > Update to latest dirdeps.mk > =20 > Take advantage of new bmake feature to only consider Makefile.depend > as invalidating DIRDEPS_CACHE. > =20 > When bootstrapping allow more filtering via .MAKE.DEPENDFILE_BOOTSTRA= P_SED > =20 > Move some comments back to where they make sense. > =20 > meta.sys.mk: add META_COOKIE_TOUCH and META_NOPHONY to better handle = some > targets in meta mode vs non-meta mode. > Also use .MAKE.META.IGNORE_PATHS to ignore mtime of makefiles - which= do > not matter in meta mode. >=20 > Modified: > head/share/mk/dirdeps.mk > head/share/mk/meta.sys.mk >=20 > Modified: head/share/mk/dirdeps.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/mk/dirdeps.mk Fri Sep 9 01:09:39 2016 (r305633) > +++ head/share/mk/dirdeps.mk Fri Sep 9 01:21:35 2016 (r305634) > @@ -1,5 +1,5 @@ > # $FreeBSD$ > -# $Id: dirdeps.mk,v 1.62 2016/03/16 00:11:53 sjg Exp $ > +# $Id: dirdeps.mk,v 1.73 2016/08/15 19:28:13 sjg Exp $ > =20 > # Copyright (c) 2010-2013, Juniper Networks, Inc. > # All rights reserved. > @@ -117,12 +117,17 @@ _DIRDEP_USE_LEVEL?=3D 0 > .if ${.MAKE.LEVEL} =3D=3D ${_DIRDEP_USE_LEVEL} > # only the first instance is interested in all this > =20 > -# First off, we want to know what ${MACHINE} to build for. > -# This can be complicated if we are using a mixture of ${MACHINE} spec= ific > -# and non-specific Makefile.depend* > - > .if !target(_DIRDEP_USE) > =20 > +# do some setup we only need once > +_CURDIR ?=3D ${.CURDIR} > +_OBJDIR ?=3D ${.OBJDIR} > + > +now_utc =3D ${%s:L:gmtime} > +.if !defined(start_utc) > +start_utc :=3D ${now_utc} > +.endif > + > .if ${MAKEFILE:T} =3D=3D ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS= :Uall:M*/*} !=3D "" > # This little trick let's us do > # > @@ -145,15 +150,6 @@ MK_DIRDEPS_CACHE =3D no > # make sure we get the behavior we expect > .MAKE.SAVE_DOLLARS =3D no > =20 > -# do some setup we only need once > -_CURDIR ?=3D ${.CURDIR} > -_OBJDIR ?=3D ${.OBJDIR} > - > -now_utc =3D ${%s:L:gmtime} > -.if !defined(start_utc) > -start_utc :=3D ${now_utc} > -.endif > - > # make sure these are empty to start with > _DEP_TARGET_SPEC =3D > =20 > @@ -224,6 +220,10 @@ N_notmachine :=3D ${.MAKE.DEPENDFILE_PREFE > =20 > .endif # !target(_DIRDEP_USE) > =20 > +# First off, we want to know what ${MACHINE} to build for. > +# This can be complicated if we are using a mixture of ${MACHINE} spec= ific > +# and non-specific Makefile.depend* > + > # if we were included recursively _DEP_TARGET_SPEC should be valid. > .if empty(_DEP_TARGET_SPEC) > # we may or may not have included a dependfile yet > @@ -386,7 +386,7 @@ BUILD_DIRDEPS ?=3D yes > .if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) > .if ${MK_DIRDEPS_CACHE} =3D=3D "yes" > # this is where we will cache all our work > -DIRDEPS_CACHE?=3D ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,= _,g:S,^,.,:N.} > +DIRDEPS_CACHE?=3D ${_OBJDIR:tA}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S= ,/,_,g:S,^,.,:N.} > =20 > # just ensure this exists > build-dirdeps: > @@ -398,6 +398,9 @@ M_oneperline =3D @x@\\${.newline} $$x@ > # we do this via sub-make > BUILD_DIRDEPS =3D no > =20 > +# ignore anything but these > +.MAKE.META.IGNORE_FILTER =3D M*/${.MAKE.DEPENDFILE_PREFIX}* > + > dirdeps: dirdeps-cached > dirdeps-cached: ${DIRDEPS_CACHE} .MAKE > @echo "${TRACER}Using ${DIRDEPS_CACHE}" > @@ -670,7 +673,10 @@ _DEP_RELDIR :=3D ${RELDIR} > make(bootstrap-recurse) || \ > make(bootstrap-empty)) > =20 > -.if exists(${.CURDIR}/${.MAKE.DEPENDFILE:T}) > +# if we are bootstrapping create the default > +_want =3D ${.CURDIR}/${.MAKE.DEPENDFILE_DEFAULT:T} > + > +.if exists(${_want}) > # stop here > ${.TARGETS:Mboot*}: > .elif !make(bootstrap-empty) > @@ -680,12 +686,19 @@ _src !=3D cd ${.CURDIR} && for m in ${.MAK > .error cannot find any of ${.MAKE.DEPENDFILE_PREFERENCE:T}${.newline}U= se: bootstrap-empty > .endif > =20 > -_src?=3D ${.MAKE.DEPENDFILE:T} > +_src?=3D ${.MAKE.DEPENDFILE} > + > +.MAKE.DEPENDFILE_BOOTSTRAP_SED+=3D -e 's,${_src:E},${MACHINE},g' > =20 > # just create Makefile.depend* for this dir > bootstrap-this: .NOTMAIN > - @echo Bootstrapping ${RELDIR}/${.MAKE.DEPENDFILE:T} from ${_src:T} > - (cd ${.CURDIR} && sed 's,${_src:E},${MACHINE},g' ${_src} > ${.MAKE.DE= PENDFILE:T}) > + @echo Bootstrapping ${RELDIR}/${_want:T} from ${_src:T}; \ > + echo You need to build ${RELDIR} to correctly populate it. > +.if ${_src:T} !=3D ${.MAKE.DEPENDFILE_PREFIX:T} > + (cd ${.CURDIR} && sed ${.MAKE.DEPENDFILE_BOOTSTRAP_SED} ${_src} > ${_= want}) > +.else > + cp ${.CURDIR}/${_src:T} ${_want} > +.endif > =20 > # create Makefile.depend* for this dir and its dependencies > bootstrap: bootstrap-recurse > @@ -705,8 +718,8 @@ bootstrap-recurse: .NOTMAIN .MAKE > =20 > # create an empty Makefile.depend* to get the ball rolling. > bootstrap-empty: .NOTMAIN .NOMETA > - @echo Creating empty ${RELDIR}/${.MAKE.DEPENDFILE:T}; \ > + @echo Creating empty ${RELDIR}/${_want:T}; \ > echo You need to build ${RELDIR} to correctly populate it. > - @{ echo DIRDEPS=3D; echo ".include "; } > ${.CURDIR}/${.M= AKE.DEPENDFILE:T} > + @{ echo DIRDEPS=3D; echo ".include "; } > ${_want} > =20 > .endif >=20 > Modified: head/share/mk/meta.sys.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/mk/meta.sys.mk Fri Sep 9 01:09:39 2016 (r305633) > +++ head/share/mk/meta.sys.mk Fri Sep 9 01:21:35 2016 (r305634) > @@ -26,6 +26,10 @@ > # absoulte path to what we are reading. > _PARSEDIR =3D ${.PARSEDIR:tA} > =20 > +.if !defined(SYS_MK_DIR) > +SYS_MK_DIR :=3D ${_PARSEDIR} > +.endif > + > META_MODE +=3D meta verbose > .MAKE.MODE ?=3D ${META_MODE} > =20 > @@ -110,10 +114,26 @@ _metaError: .NOMETA .NOTMAIN > =20 > .endif > =20 > +META_COOKIE_TOUCH=3D > +# some targets need to be .PHONY in non-meta mode > +META_NOPHONY=3D .PHONY > # Are we, after all, in meta mode? > .if ${.MAKE.MODE:Uno:Mmeta*} !=3D "" > MKDEP_MK =3D meta.autodep.mk > =20 > +# we can afford to use cookies to prevent some targets > +# re-running needlessly > +META_COOKIE_TOUCH=3D touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}}= > +META_NOPHONY=3D > + > +# some targets involve old pre-built targets > +# ignore mtime of shell > +# and mtime of makefiles does not matter in meta mode > +.MAKE.META.IGNORE_PATHS +=3D \ > + ${MAKEFILE} \ > + ${SHELL} \ > + ${SYS_MK_DIR} I think it could be problematic to ignore *.mk changes. The build commands may stay the same, but targets could grow new dependencies. If those dependencies are already "met" then meta mode won't reconsider them= =2E Consider: Build 1: bar: touch dep touch bar foo: touch foo all: bar foo In the first build, all generates dep, bar and foo. Then the code is changed to: bar: touch bar dep: touch notmade touch dep foo: dep touch foo all: foo bar Now in the second build, all finds bar command changes and rebuilds, finds foo command is the same and that dep is already satisfied from the last build. So 'notmade' is never made. > + > # if we think we are updating dependencies,=20 > # then filemon had better be present > .if ${UPDATE_DEPENDFILE:Uyes:tl} !=3D "no" && !exists(/dev/filemon) >=20 --=20 Regards, Bryan Drewery --kdxOXeX0WTFb1VliHB6D3XS12MGCssu1X-- --b2LLHF3rXQuC7goSJGUI0wKvg1qFKiJC4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJX0v99AAoJEDXXcbtuRpfPjFgH/3VJYrei1zJwZ7up0EoxKAR6 432UIDjDACoHmoi/2zVRJ/9WRXqj0MB6HHwOo1Hg+kxtgU8Urq20Iwoc07ExpPZp 1XFj2Tevu4OD1He4MqJ/bGxxaxv5yrPrU+E3dVjrKK9CmoXXmxSZZP5/8+pVQc+N srJgSmL5Nui66bVg6buiPooQWtUNdvPsJbDyjzN+D79ias12L7lx5AxhhGrK6xme buw3CImAlb81bWG06kb4DPTXlykigubSQUWcB7gJFAyd6y2Tj27HKEQ71as5GwQj CTXl1L6HF9txfw9K/jWA/ckiUmO18RLA0YKtbE2cF3QG9LrdsOOCTAr0YSlCuUM= =BpF4 -----END PGP SIGNATURE----- --b2LLHF3rXQuC7goSJGUI0wKvg1qFKiJC4--