[ccache] basename of source file in hashed name in ccache

Frank Klotz frank.klotz at alcatel-lucent.com
Fri Nov 4 18:26:06 MDT 2011

  I used ccache at my previous employer, and was very convinced of its 
value.  Now that I have started a new job, I am in the process of trying 
to bring the new shop on board with ccache, so I am really digging into 
how it works.  I have downloaded ccache 3.1.6, built and installed it, 
and I am playing with it.

One thing puzzles me.  At my previous job, I remember quite clearly (and 
I just confirmed with a colleague who is still there) that the file 
names in the cache contained BOTH the hash AND the basename of the 
object file.  (E.g., if the file would be pulled out of the cache into 
the user's directory as foo.o, its name in the cache included both a 
nice long hash string AND the string "foo.o".

In contrast, with my download of 3.1.6, I see anonymous files in the 
cache, with JUST the hash (and another string that the ccache code 
refers to as "size", although I can't quite figure out what it's the 
size OF) in the filename.  No obvious way to connect files in the hash 
to their basenames.

One place we found the basenames invaluable was tracking down a 
corrupted object file in the cache.  Once we confirmed that we had a 
corrupt object file foo.o, we simple searched for all "*foo.o" files in 
the cache, compared those in size and content to an actual corrupted 
object file in the user directory, and easily removed the corrupted file 
from the cache.  Much harder (not impossible, but harder) to do this 
without the basenames.

But it's odd to me that an older version of ccache had this feature but 
3.1.6 does not.  Was this feature ever on the mainline of ccache 
development.  If so, it must have been removed for a reason - does 
anyone know what that reason WAS?  I suppose it is possible that this 
was a local enhancement, added and maintained by someone at my former 
employer (a large telecom firm) but never passed back to the central 
repository (or offered but not accepted?).

Anyway, is there a general consensus on whether this would be valuable?  
How would we go about adding it?

Frank Klotz

More information about the ccache mailing list