Re: does ccache include source code modified time into hash?
Andrew Stubbs <[email protected]> Thu, 13 Nov 2014 13:27:03 +0000
| Newsgroups | gmane.comp.compilers.ccache |
|---|---|
| Message-ID | <[email protected]> |
On 13/11/14 01:28, Makson Lee wrote: > 2014-11-13 4:44 GMT+08:00 Andrew Stubbs <[email protected] > <mailto:[email protected]>>: > > However, it might appropriate to list the factors that can lead to a > cache miss, and mention some of the factors that explicitly do not > cause a miss. > > > Yes, i think the factors that can lead to a cache miss would be enough, > currently, we are using some kind of version control tool, each time we > reload the same code and recompile it, we get lots of cache miss, so we > need that information to find out why cache miss happens, in direct > mode, maybe a tool can show us all the factors for a source file before > compile would be help too. The usual cause is that you don't always use the exact same checkout location (pathnames *are* factored into the signatures). CCACHE_BASEDIR is designed to fix that, but it does have documented side-effects. Some compiler flags are also uncachable (or unsupported). You should be able to see if that's what you're getting using "ccache -s". And then, some projects just seems to like to resist caching. The Linux kernel is one. You can make once, then make clean, and the cache will work, but it will never cache the initial build of a fresh tree. I forget why (I did know once), but I seem to recall that there was nothing to do about it. Probably there was a timestamp in a generated header somewhere. Andrew