[ccache] ccache false cache hit when creating precompiled headers

Mark Fieldhouse mark at mediasolutions.co.uk
Tue Aug 12 13:59:54 MDT 2014

Hi Joel,
This doesn't fix the original bug report. As far as I can see the fix is
in the area of USING precompiled headers not CREATING them.
Can you re-open the original bug or should I create a new one?
I have a brute force fix that stops ccache from caching precompiled
headers all together.
But you could probably come up with a better fix.
I can show you simply how to reproduce the problem in a few lines.
In testing I used the tip version of ccache on the master branch.
-----Original Message-----
From: joel.rosdahl at gmail.com [mailto:joel.rosdahl at gmail.com] On Behalf
Of Joel Rosdahl
Sent: 08 August 2014 09:37
To: Mark Fieldhouse
Cc: ccache list
Subject: Re: [ccache] ccache false cache hit when creating precompiled
Hi Mark,
See https://bugzilla.samba.org/show_bug.cgi?id=10212.
-- Joel
On 4 August 2014 22:09, Mark Fieldhouse <mark at mediasolutions.co.uk>

ccache appears to break our compilation by incorrectly retrieving cached
precompiled headers.

The problem is our build has a header file which has;

void func(int x);

This gets compiled and put in the cache by ccache.
We then change the file to be;

void func(int x);

And ccache runs its own 'direct' hash function and correctly decides
that the file is not in the cache.
Then it runs the C pre-processor and hashes the output.

The output of the C pre-processor hasn't changed so ccache incorrectly
retrieves the cached version of the file
Which has;

Failed build.

Let me know if this is a known issue or if you'd like me to raise a bug

ccache mailing list
ccache at lists.samba.org

More information about the ccache mailing list