Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2007 00:06:28 -0500
From:      "illoai@gmail.com" <illoai@gmail.com>
To:        "Maxim Khitrov" <mkhitrov@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: ccache never "hits" on buildworld or buildkernel
Message-ID:  <d7195cff0708122206wf65d36cv3faef8d602c686db@mail.gmail.com>
In-Reply-To: <26ddd1750708122157n70e6b832p33d378c75c8fd698@mail.gmail.com>
References:  <26ddd1750708122157n70e6b832p33d378c75c8fd698@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12/08/07, Maxim Khitrov <mkhitrov@gmail.com> wrote:
> Hello,
>
> I'm using ccache to build FreeBSD source and ports. Ports work great,
> I build something once and the second time just about everything is
> found in the cache. For buildworld and buildkernel, however,
> everything is a miss. Even when not a single thing changed about the
> configuration or the actual source files.
>
> Below is my make.conf configuration for ccache. Ccache is being used
> via world-cc and world-c++ binaries for these two operations; I can
> see the miss counter go up in 'ccache -s'. Why is it unable to
> properly cache when building the source?
>
> Thanks.
>
> make.conf:
>
> .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) && \
>     !defined(NOCCACHE) && exists(/usr/local/libexec/ccache)
> CC= /usr/local/libexec/ccache/world-cc
> CXX=/usr/local/libexec/ccache/world-c++
> .endif
>
> .if !empty(.CURDIR:M/usr/ports*) && !defined(NOCCACHE) \
>     && exists(/usr/local/libexec/ccache)
> CC= /usr/local/libexec/ccache/cc
> CXX=/usr/local/libexec/ccache/c++
> .endif
>
> uname -a:
>
> FreeBSD -.-.- 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Sun Aug 12 15:45:05
> EDT 2007     max@-.-.-:/usr/obj/usr/src/sys/KERNEL  i386

I believe ccache checks the compiler itself before issuing
a "hit".  Since the buildworld process rebuilds the compiler
ccache thinks it's a different compiler and issues a "miss".

>From man ccache:

 CCACHE_NOHASH_SIZE_MTIME
              This tells ccache to not hash the real compiler's size and modi-
              fication time. Normally this is the mechanism to detect compiler
              upgrades.  There are situations however, where even  though  the
              compiler's  size or modification time has changed you can safely
              use the cached objects (e.g. if as part of your build system the
              compiler  is  built  as  well  and the compiler's source has not
              changed; or if the compiler has only changes that do not  affect
              code generation). Use this feature only if you know what you are
              doing.

I hope this helps?

-- 
--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d7195cff0708122206wf65d36cv3faef8d602c686db>