[ccache] Automatic fallback from preprocessed to direct mode in case of cache miss

Rémi Delmas remi.delmas at gmail.com
Fri Jun 24 00:02:36 MDT 2011


Hello,

Thanks a lot for your answer. I must apology, as shortly after sending my
questions, I had a look at the very nice and well documented code, and found
my answer. I also did some testing, and ccache does exactly what I want. I
did not have the opportunity of re-posting before you did. :-)

In some big project I work on, compilation took 10 minutes with no ccache at
all, 4:30 with ccache in preprocessed mode, and 1 minute in direct mode.
Really really nice.

Thanks again,
-- 
Remi

2011/6/23 Joel Rosdahl <joel at rosdahl.net>

> Hi,
>
> On 2011-06-23 17:15, Rémi Delmas wrote:
> > [...]
> > Another solution would be for ccache to automatically fallback to
> > preprocessed mode in case direct mode fails.
>
> That's precisely what ccache does already (and direct mode is the
> default; you don't need to set CCACHE_BASEDIR to activate it). See
> http://ccache.samba.org/manual.html#_how_ccache_works for more details.
>
> If I understand your description correctly, your problem has to do with
> the -I options being different in the two scenarios, like this:
>
>  Case A:
>    cd ~A/dev/ProjectA
>    gcc -I../ProjectB -c header.c
>
>  Case B:
>    cd ~B/ProjectA
>    gcc -I../development/ProjectB -c header.c
>
> Right?
>
> The direct mode can't be made to work for this case, so there's nothing
> to configure to make it work. The direct mode simply needs to see
> exactly the same compiler options (including -I) to kick in, and then it
> will search for header files in exactly the same places the previous
> compilation found them.
>
> So, I'm afraid you have to encourage or enforce users A and B to use the
> same directory layout to benefit from the direct mode (or invent
> something more clever).
>
> -- Joel
> _______________________________________________
> ccache mailing list
> ccache at lists.samba.org
> https://lists.samba.org/mailman/listinfo/ccache
>


More information about the ccache mailing list