Subject: Re: stale dependency files breaking build considered harmful
To: Greg Troxel <gdt@ir.bbn.com>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-toolchain
Date: 02/11/2006 22:17:21
>I updated sources on a machine that hadn't been updated since 12/1 or
>so, and on running build.sh the build failed because in two places
>(named, libc) files that were in a .depend file were no longer
>present.  It seems that 'dependall' reads .depend and fails before
>regenerating .depend, and that 'cleandir' is necessary to recover.
>Actually, I was able to recover by deleting .depend files.

>It is unfortuante that this sort of lossage occurs.  I'm not
>complaining about files being removed - that's normal.  I wonder if

There's a trade off to make, between speeding up the average build
and avoiding this sort of lossage.  Some years ago, our build at work 
ditched any sort of separate dependency management - the .depends are 
generated as a side effect of compiling.  True, as you note, this will
result in a build stoppage when a header is removed or renamed, but
that is quite a rare event (compared to the 100's of builds done daily).

Even this lossage is easily dealt with by the simple strategy of
running the build via a script which spots failure, idendifies the directory
where the build failed, (cd thatdir && make clean), then start again.
Of cours that doesn't help unless the build phases can be easily separated.

Absent all that, perhaps a target to do the .depend cleanup you descirbed
to cover the case where a tree is being built for the first time in months,
would be preferable to paying that overhead for every build.

--sjg