[ccache] Sharing ccache among different workspaces.

Sunny Jose sunju_jose at yahoo.com
Mon Apr 28 19:29:47 MDT 2014


I want to share the ccache built using one workspace to be utilized by another workspace, so that one copy of ccache data is used for compiling identical source code.
E.x: 1) Created a workspace (home/user/source_code1). 2) synced the code here from the server. 3) Compiled the Code with USE_CCACHE=1
The above will build my ccache. Now I do the following
Case 1: 1) Created a workspace (home/user/source_code2). 2) synced identical source code here from the server. 3) Did the same compilation as I did in the earlier workspace.
Case 2: 1) Delete workspace home/user/source_code1 2) Re-create the earlier workspace (home/user/source_code1). 2) Re-synced the code here from the server. 3) Compiled the Code with USE_CCACHE=1
I want source_code2 compilation to use the ccache built from source_code1 and when I delete and re-create the same workspace, I need the compilation to happen with the ccache already built. Any pointers to achieve the same are welcome!
The result that I see now in both the above cases is though ccache is built it is never used or there are no hits in the ccache, it keeps on getting built up whenever a new workspace is used, If I just clean the build and re-compile in the same workspace without deleting any earlier source code(home/user/source_code1), then ccache compilation jumps in and there are hits which help in reducing the build time.
Any idea why I do not see any ccache hits whenever a brand new workspace is used?
I always have the "ccache miss" incremented rather than the "cache hit (direct) , or , cache hit (preprocessed) ". Also the "cache hit (direct)" is always 0.

I have set the following variables.

CCACHE_BASEDIR= /home/user

Kindly please let me know if I'm missing something obvious here.

More information about the ccache mailing list