From owner-freebsd-current@FreeBSD.ORG Thu Jul 24 12:12:53 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE01237B401 for ; Thu, 24 Jul 2003 12:12:53 -0700 (PDT) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65D2443FBD for ; Thu, 24 Jul 2003 12:12:52 -0700 (PDT) (envelope-from kientzle@acm.org) Received: from acm.org ([66.166.149.53]) by kientzle.com (8.12.9/8.12.9) with ESMTP id h6OJCqsE032644; Thu, 24 Jul 2003 12:12:52 -0700 (PDT) (envelope-from kientzle@acm.org) Message-ID: <3F202FB7.8010609@acm.org> Date: Thu, 24 Jul 2003 12:12:55 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.1) Gecko/20021005 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Garance A Drosihn References: <20030716181354.GA44980@dan.emsphone.com> <20030717074756.B17029@gamplex.bde.org> <20030717123524.T24327@schnell.net> <20030718154832.K21942@gamplex.bde.org> <20030718095946.H29869@schnell.net> <3F183EF9.7020506@acm.org> <20030721084750.GH12996@roark.gnf.org> <3F1C1695.30409@acm.org> <20030723234415.GE12996@roark.gnf.org> Content-Type: multipart/mixed; boundary="------------070009000100030605080704" cc: current@freebsd.org Subject: Re: Buildworld /rescue failures in 5.1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2003 19:12:54 -0000 This is a multi-part message in MIME format. --------------070009000100030605080704 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Garance A Drosihn wrote: > Wed Jul 23 20:08:06 EDT 2003 Starting make depend > in /usr/obj/usr/src/rescue/rescue/usr/src/gnu/usr.bin/gzip > Wed Jul 23 20:08:07 EDT 2003 Finished make depend > in /usr/obj/usr/src/rescue/rescue/usr/src/gnu/usr.bin/gzip > Wed Jul 23 20:08:09 EDT 2003 Starting make depend > in /usr/obj/usr/src/rescue/rescue/usr/src/gnu/usr.bin/tar > > So indeed, that 'make depend' had not finished before the 'make' > for the object had started. > There's another possibility here: suppose two copies of make are running simultaneously and both get to this sequence at about the same time: tar_make: (cd $(tar_SRCDIR) && \ $(MAKE) $(BUILDOPTS) $(tar_OPTS) depend &&\ $(MAKE) $(BUILDOPTS) $(tar_OPTS) $(tar_OBJS)) The first make to run this will start building dependencies. The second copy will see that ".depend" already exists (note that bsd.dep.mk builds .depend incrementally) and then go on to the next step. Depending on the exact timing, this could result in an attempt to build the object files with an incomplete '.depend' file. I wonder if something like the attached patch (which causes .depend to be created atomically) affects things? Tim --------------070009000100030605080704 Content-Type: text/plain; name="kientzle_bsd.dep.mk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kientzle_bsd.dep.mk.diff" Index: share/mk/bsd.dep.mk =================================================================== RCS file: /usr/cvs/FreeBSD-CVS/src/share/mk/bsd.dep.mk,v retrieving revision 1.41 diff -u -r1.41 bsd.dep.mk --- share/mk/bsd.dep.mk 3 Jul 2003 11:43:57 -0000 1.41 +++ share/mk/bsd.dep.mk 24 Jul 2003 19:08:11 -0000 @@ -112,25 +112,29 @@ # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. +PID != /bin/sh -c 'echo $$$$' + ${DEPENDFILE}: ${SRCS} - rm -f ${DEPENDFILE} + rm -f ${DEPENDFILE} ${DEPENDFILE}.${PID} .if ${SRCS:M*.[cS]} != "" - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + ${MKDEPCMD} -f ${DEPENDFILE}.${PID} -a ${MKDEP} \ ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} \ ${.ALLSRC:M*.[cS]} .endif .if ${SRCS:M*.cc} != "" || ${SRCS:M*.C} != "" || ${SRCS:M*.cpp} != "" || \ ${SRCS:M*.cxx} != "" - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + ${MKDEPCMD} -f ${DEPENDFILE}.${PID} -a ${MKDEP} \ ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BID]*} \ ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cpp} ${.ALLSRC:M*.cxx} .endif .if ${SRCS:M*.m} != "" - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + ${MKDEPCMD} -f ${DEPENDFILE}.${PID} -a ${MKDEP} \ ${OBJCFLAGS:M-nostdinc*} ${OBJCFLAGS:M-[BID]*} \ ${OBJCFLAGS:M-Wno-import*} \ ${.ALLSRC:M*.m} .endif + mv ${DEPENDFILE}.${PID} ${DEPENDFILE} + rm -f ${DEPENDFILE}.${PID} .if target(_EXTRADEPEND) _EXTRADEPEND: .USE ${DEPENDFILE}: _EXTRADEPEND --------------070009000100030605080704--