cache directory /home/travis/.ccache
primary config /home/travis/.ccache/ccache.conf
secondary config (readonly) /etc/ccache.conf
stats updated Tue Jul 21 07:32:09 2020
cache hit (direct) 551
cache hit (preprocessed) 21
cache miss 13001
cache hit rate 4.21 %
called for link 4050
called for preprocessing 1059
preprocessor error 322
unsupported source language 6
autoconf compile/link 9
unsupported code directive 9
no input file 2538
cleanups performed 0
files in cache 38652
cache size 518.3 MB
max cache size 5.0 GB
If I building on my local machine it looks more like this:
stats updated Mon Jul 20 12:42:28 2020
cache hit (direct) 48189
cache hit (preprocessed) 143
cache miss 13180
cache hit rate 78.57 %
called for link 84581
called for preprocessing 21319
compiler produced empty output 210
preprocessor error 469
unsupported code directive 49
no input file 5210
cleanups performed 0
files in cache 36100
cache size 518.7 MB
Any hints?
Maybe separate caches for buster and stretch, but the wiki isnāt very helpful at this point.
Iām not sure how ccache match the files (path, hash?), but it clearly doesnāt match it.
For example the last build cache (Travis CI - Test and Deploy with Confidence) took at the beginning 1.2GB, thatās much more then it normally take. And at the end of the build it increased to 1.4GB.
Maybe this could be a hint. I found this in the manual of ccache CCACHE(1)
Bottom line: you need to ensure that arm-linux-gnueabihf-gccās mtime stays the same across builds, or adjust the compiler_check CCache setting.
I see that the cache is being stored and fetched correctly despite the creating directory /home/travis/.ccache message (previously, it only appeared if the directory wasnāt in the cache. Now, it seems to appear always).
Iāve run the build 4 times and got roughly 4x the number of files in the cache. This suggests that the files you are compiling are somehow different every time from CCacheās POV.
Indeed, unexpectedly enough, Git doesnāt save mtime (unlike e.g. tar)! So if you git clone your compilation tools rather than unpack them from a tarball, the compiler will have a different mtime each time!