Subject: Re: tools/Makefile parallel make issue
To: None <david@l8s.co.uk>
From: Havard Eidnes <he@uninett.no>
List: tech-toolchain
Date: 08/02/2006 15:12:01
> On Thu, Jul 06, 2006 at 05:25:02PM +0200, Lubomir Sedlacik wrote:
> >
> > the failure was caused by a "cleandir" running in parallel within t=
he
> > same directory "dependall" was just spawned (running configure at t=
he
> > moment), in tools/compat.
> >
> > the problem seems to lie in src/tools/Makefile:
> >
> >   realall realdepend: .MAKE
> >   .if "${PREVIOUSTOOLDIR}" !=3D "${TOOLDIR}"
> >           @echo "*** WARNING: TOOLDIR has moved?"
> >           @echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
> >           @echo "***     !=3D  TOOLDIR '${TOOLDIR}'"
> >           @echo "*** Cleaning mis-matched tools"
> >           rm -f PREVIOUSTOOLDIR
> >           (cd ${.CURDIR} && ${MAKE} cleandir)
> >   .endif
>
> There is no way to get a single make command to execute commands that=

> delete files and commands that create the same ones.

Is that really what's required here, though?

I would have thought that if the cleandir command completed before the
rest was executed would have been sufficient, since most of the action
here happens in subdirs, presumably in separate make processes?

BTW, in the August 1 autobuild results, 15 of the 34 failed builds
failed because a parallel cleandir interfered with the configure phase
for some of the tools.

I'm on thin ice here, I know, but would it help making the above
command sequence (plus the missing "echo ${TOOLDIR} >PREVIOUSTOOLDIR")
a separate target, and putting a .WAIT after it help in any way?  Such
as...

Index: Makefile
=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
RCS file: /u/nb/src/tools/Makefile,v
retrieving revision 1.104
diff -u -r1.104 Makefile
--- Makefile    19 Jul 2006 09:54:47 -0000      1.104
+++ Makefile    2 Aug 2006 12:49:28 -0000
@@ -128,7 +128,7 @@
 =

 CLEANFILES+=3D   PREVIOUSTOOLDIR
 =

-realall realdepend: .MAKE
+check_TOOLDIR: .NOTMAIN
 .if "${PREVIOUSTOOLDIR}" !=3D "${TOOLDIR}"
        @echo "*** WARNING: TOOLDIR has moved?"
        @echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
@@ -139,6 +139,7 @@
 .endif
        echo ${TOOLDIR} >PREVIOUSTOOLDIR
 =

+realall realdepend: check_TOOLDIR .WAIT .MAKE
 # For each .WAIT point, make sure the immediately preceding target is
 # installed before building anything after that point.
 #

Trying to reproduce this problem on a single-CPU system appears to be
difficult.  Either that or my test machine is too slow.

Regards,

- H=E5vard