I'm having trouble getting consistent benefit from ccache
in my jenkins pipeline builds. I'm setting CCACHE_BASEDIR
to the parent directory of my current build directory (this works out to something like /opt/jenkins/workspace
). Given this basedir, I would expect all PR/branch builds that share this common parent to be able to find hits in the cache, but alas they do not. I do see cache hits for subsequent builds in a given directory (if I manually rebuild a particular PR, for example), which implies that CCACHE_BASEDIR
is not working like I would expect.
To further diagnose, I've tried setting CCACHE_LOGFILE
and although that file is produced by the build, it is effectively empty (it contains only two lines indicating the version of ccache).
Can anyone suggest specific settings or techniques that have worked to get maximum benefit from ccache
in jenkins pipelines, or other things to try to diagnose the problem? What might cause the empty ccache log file?
I'm running ccache
3.3.4.