I was confused for a minute upon doing this why ccache had spontaneously stopped working, so it would be nice to handle the error rather than segfaulting.
This was fixed in ccache 3.1.8, please give it a spin.