[ccache] ccache compression patch (was: The future of ccache)

Joel Rosdahl joel at rosdahl.net
Thu Jan 7 12:10:03 MST 2010

On Thu, 7 Jan 2010 09:22:27 +1100
tridge at samba.org wrote:

> For example, the compression patch is badly
> done I think (it doesn't cope with changing the compression option -
> it should either use a .gz extension for compressed cache files, or
> recognise them by reading the header).

Hm, I don't see that problem with the patch. Can you elaborate?
Regardless of the CCACHE_NOCOMPRESS setting and the type of file, it
uses gzdopen+gzread to read the file, and gzread works on uncompressed
files too.

The only problem I saw with the patch is that it breaks forward
compatibility of ccache versions without the compression patch since
the hash sum and therefore the file name is the same for compressed and
uncompressed cache files. I think that's unfortunate, so to avoid this,
I made the hash sums for compressed and uncompressed files different.
A .gz extension for compressed files would of course work too, with
different trade-offs.


More information about the ccache mailing list