On 18 February 2017 at 00:54, Ben Hutchings <b...@decadent.org.uk> wrote: > I've also found that disabling direct mode (CCACHE_NODIRECT=1) is a workaround, > at least in this case.
Yes. When the direct mode is disabled, dependency files are created fresh by the preprocessor instead of taken from the cache. > The problem seems to be that a direct mode manifest contains a hash of > the source and object files, but not any other associated output files. Hm, not quite. The manifest (looked up from a hash of source code file + command line arguments) contains a mapping from a set of include file hashes to output file names (used for object file, dependency file and a handful other types of output files). The output file names are in turn based on a hash of the preprocessed output of the compilation. There's no hash of the object file itself or any other output file. However, what I call "output file name" above is called "object" in the manifest source code, which is misleading. I'll change it! :-) See https://ccache.samba.org/manual.html#_the_direct_mode if you're interested in more details on how the direct mode works. > It seems to be assumed that if the object files are identical then so any other output files > will also be identical, and that's not the case. I wouldn't call it an assumption but rather an unforeseen side effect of the "names of included files are no longer included in the hash of the compiler's preprocessed output" feature that snuck into ccache 3.3. -- Joel