[ccache] ccacje direct mode without fall back to running the preprocessor

Andrew Stubbs ams at codesourcery.com
Wed Dec 16 10:21:19 UTC 2015

On 10/12/15 19:32, vkr wrote:
> Sorry. It is not the manifest file that it tries to update. But the ".d"
> files. I think it is a real bug.
> In read-only mode, when ccache tries to run cache look up in
> preprocessor mode, it tries to put_file_in_cache for .d file
> unconditionally.
>          if (generating_dependencies && mode == FROMCACHE_CPP_MODE) {
>                  put_file_in_cache(output_dep, cached_dep);
>          }
> This is buggy, as it should check also check we are in
> read-only/read-only-direct mode, like so:
> if (generating_dependencies && mode == FROMCACHE_CPP_MODE &&
> (!conf->read_only && !conf->read_only_direct)) {
> Or even better, if put_file_in_cache returns if we are in
> read-only/read-only-direct mode, which should fix more such hidden
> cases, in future.

I think you're right, and I'm sure Joel would appreciate a patch if you 
could cook one up and test it.

I'm not the maintainer, so my opinion on the placement of the fix is not 
interesting. I would follow whatever precedent has been set elsewhere, 
and only "fix" it if things are getting out of hand.


More information about the ccache mailing list