[ccache] Why not cache compile failures?

Andrew Stubbs ams at codesourcery.com
Mon Sep 24 02:44:12 MDT 2012

On 22/09/12 13:13, Joel Rosdahl wrote:
> On 18 September 2012 14:16, Andrew Stubbs <ams at codesourcery.com> wrote:
>> I'm aware that there's some danger here that we can end up caching Ctrl-C
>> interrupts, SIGTERM/SIGKILL terminations, out-of-memory failures, and all
>> manner of other non-reproducible failures, but these are the unusual case,
>> and nothing that can't be fixed with CCACHE_RECACHE.
> I would be OK with caching failures if it's off by default and doesn't
> affect the default's performance. Have you thought about how to store
> the exit code in the cache?

The simplest way would be a tiny file in the cache that just contained 
the code. Say with extension ".error".

I'd prefer it to be on by default, if only to prevent other devs 
breaking it, but that's your decision to make, of course.

>> I might suggest emitting an extra warning message that informs the user that
>> they are seeing a cached failure.
> Printing an extra warning message would break ccache's transparency,
> but perhaps that would be acceptable for failures. Have to think more
> about it.

It would definitely break the compiler testsuite, but if you're testing 
that through ccache you have bigger problems.

Otherwise, I don't know of any cases where scripts check error/warning 
messages beyond whether they exist or not. Since I would have it only 
emit the "warning" when there are already "error" messages, it would 
only break in unusual cases.

Thanks for your feedback, I'll have a bash at it soonish.


More information about the ccache mailing list