[ccache] Why not cache compile failures?

Andrew Stubbs ams at codesourcery.com
Fri Oct 5 03:10:42 MDT 2012


On 30/09/12 02:23, Martin Pool wrote:
> Depending on the compiler, it may be possible to see from the
> waitstatus that it was interrupted, and so to avoid caching the
> result.  Or, perhaps you can do something with process groups to let
> ccache observe the interrupt signal itself and so be sure not to cache
> it.

Yes, I think it's probably reasonable to only cache failures where the 
return code is not a signal. The compiler does handle SIGSEGV ("Internal 
compiler error") but not other signals, I think, so that works out quite 
nicely.

> If you emit a message when printing a cached error it ought to be safe
> enough to experiment with.

Agreed, I was thinking of something like this:

file.c: warning: This compile failure has been cached by ccache.
file.c: warning: Set CCACHE_RECACHE=1 to try the compiler again.

> As much as possible we want things to be pure functions of the input,
> both in the input to ccache, and in how ccache itself behaves.

Agreed, I hate it when I spend all day trying to figure out what's 
broken, and then tomorrow it just works. Sure, I'm unstuck, but I've 
learned nothing.

Andrew


More information about the ccache mailing list