From owner-svn-src-head@FreeBSD.ORG Sun Oct 21 04:50:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BBE4E7AE; Sun, 21 Oct 2012 04:50:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 31DA18FC08; Sun, 21 Oct 2012 04:50:01 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9L4nvsc016612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 21 Oct 2012 15:49:59 +1100 Date: Sun, 21 Oct 2012 15:49:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar Subject: Re: svn commit: r241790 - head/share/mk In-Reply-To: <201210202244.q9KMiMer023523@svn.freebsd.org> Message-ID: <20121021151723.D926@besplex.bde.org> References: <201210202244.q9KMiMer023523@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=IbXfwhWa c=1 sm=1 a=lPAooKO-k10A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=wq_FEnq2wwYA:10 a=ZK8GlRZVlntSAGWKRaQA:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 21 Oct 2012 04:50:02 -0000 On Sat, 20 Oct 2012, Marcel Moolenaar wrote: > Log: > Revert r241752. The claim that it's more correct while at the same time > causing a build breakage is interesting to say the least. Does it work to do: > Modified: head/share/mk/bsd.dep.mk > ============================================================================== > --- head/share/mk/bsd.dep.mk Sat Oct 20 19:38:22 2012 (r241789) > +++ head/share/mk/bsd.dep.mk Sat Oct 20 22:44:22 2012 (r241790) > @@ -95,17 +95,16 @@ CLEANFILES+= ${_LC} > SRCS:= ${SRCS:S/${_YSRC}/${_YC}/} > CLEANFILES+= ${_YC} > .if !empty(YFLAGS:M-d) && !empty(SRCS:My.tab.h) > -y.tab.h: ${_YSRC} > +.ORDER: ${_YC} y.tab.h (1) Change the order of the files here, so that it is expected that ${_YC} ends up newer than y.tab.h. > +${_YC} y.tab.h: ${_YSRC} > ${YACC} ${YFLAGS} ${.ALLSRC} > -${_YC}: y.tab.h > cp y.tab.c ${_YC} (2) After the cp, add "sleep 0.1; touch ${_YC}" to try to ensure that the file that is expected to be newer actually is newer. Shouldn't be needed after (1). Without (1), touch y.tab.h instead, but it seems more natural for the .c file to end up newer. > CLEANFILES+= y.tab.c y.tab.h > .elif !empty(YFLAGS:M-d) > .for _YH in ${_YC:R}.h > -${_YH}: ${_YSRC} > +${_YH}: ${_YC} > +${_YC}: ${_YSRC} > ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} > -${_YC}: ${_YH} > - @touch ${.TARGET} This only reverts to the previous buggy version. It is still missing the .ORDER directive and just shuffles the order in the bogus dependency chain. (3) After restoring the .ORDER directive, reverse the order of the files in it. (4) After the yacc command, add "sleep 0.1; touch ${_YSRC}". Now there is no cp to touch the .c file, so we must do something to try to ensure that it is newer. We could also append an empty line to it and not have to sleep for a while to ensure that clock used by touch(1) is in advance of the clock used by the kernel for timestamps (appending the empty line uses the kernel timestamp clock, which is the same as the one used for setting the mtime for y.tab.h, except in exotic cases like someone changing vfs.timestamp.precision or stepping the clock backwards underneath us. Otherwise, the sleep might even need to be N + 0.1 seconds, where N is the file system granularity in seconds and 0.1 is a safety margin for incoherent clocks (enugh for HZ = 10). N != 0 would be needed if we needed a time strictly later, but I think make only needs non-strictly later. > SRCS+= ${_YH} > CLEANFILES+= ${_YH} > .endfor > Bruce