[ccache] dependency information not updated correctly

Joel Rosdahl joel at rosdahl.net
Sat Jul 28 09:49:40 MDT 2012


Hi Bruce,

On 21 July 2012 00:56, bruce robertson <bruce.e.robertson at intel.com> wrote:
> I have two trees I do builds in.
> [...]
> So say initially the ccache is clean (easily caused by ccache -C). I
> build totally in tree number 1. Now many dependency files will have full
> pathnames of the compilers stddef.h, float.h, stdarg.h etc. files. E.g.,
>  /ssd/repos/jb-ia-pc_std/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/../lib/gcc/i686-linux-android/4.6.x-google/include/stdarg.h
> [...]
> The dependency files fetched from ccache refer to a tree 1's compiler's
> system files rather than the tree I'm using.

ccache assumes that when running the same compiler twice with the same
arguments (but potentially in different current working directories),
the result will be the same. It sounds like that isn't the case for
you. Since you use two different compilers (one for each tree, if I
understand you correctly), ccache is supposed to separate the results
of the two by including the mtime and size of the compiler in the
hash. Have you perhaps set CCACHE_COMPILERCHECK to "none"? Or does the
compiler make use of the current working directory to select which
system headers to use?

> Now I decide I'm done with tree number 1, I delete or just rename it. If
> I now do a make in tree number 2, all objects that refer to the
> "missing" compiler include files will be rebuilt as I suppose ccache
> assumes I have done something consistent like renaming some underlying
> dependency.

ccache doesn't trigger rebuilds by itself - rebuilds are done by the
build system, in this case probably since dependencies of the object
files (as specified in the depenceny files) no longer exist.

-- Joel


More information about the ccache mailing list