Re: Buildworld /rescue failures in 5.1

From: Garance A Drosihn <drosih_at_rpi.edu>
Date: Thu, 24 Jul 2003 16:33:02 -0400
At 12:12 PM -0700 7/24/03, Tim Kientzle wrote:
>Garance A Drosihn wrote:
>>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.

I am still not exactly sure what is going on here, but it
looks like Gordon has committed a change which has solved
the problem which I kept running into.  It's a little
tricky to figure out exactly what is going on, since the
problem so dependent upon the exact timing of the events.

However, I would note that in at least some of my testing,
the .depend file did *not* exist -- not at all -- in the
directory that it needed to be in.

Still, it does sound like a good idea to make the creation
of .depend to be an atomic operation.  I might prefer to use
the 'mktemp' command, instead of adding a PID.  Something
along the lines of:
DEPENDTMP=`mktemp ${DEPENDFILE}.XXXXX`

-- 
Garance Alistair Drosehn            =   gad_at_gilead.netel.rpi.edu
Senior Systems Programmer           or  gad_at_freebsd.org
Rensselaer Polytechnic Institute    or  drosih_at_rpi.edu
Received on Thu Jul 24 2003 - 11:33:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:16 UTC