Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2015 08:50:35 -0700
From:      Freddie Cash <fjwcash@gmail.com>
To:        =?UTF-8?Q?Juan_Ram=C3=B3n_Molina_Menor?= <listjm@club.fr>
Cc:        FreeBSD-Current <freebsd-current@freebsd.org>
Subject:   Re: [CFT] Buildworld ccache support
Message-ID:  <CAOjFWZ6VR3Wr75vBeBpLnTQ=Ym7PA-HLAWCEYqbuuYnb5jTD3w@mail.gmail.com>
In-Reply-To: <56264279.7020504@club.fr>
References:  <56264279.7020504@club.fr>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, Oct 20, 2015 at 6:32 AM, Juan Ramón Molina Menor <listjm@club.fr>
wrote:

> Hi!
>
> I’m certainly doing it wrong, because CCACHE does not kick in after
> applying the patch and modifying make.conf. CCACHE stats ('ccache -z'
> followed by 'ccache -s') remain at zero during buildworld while they used
> to reflect the cache miss/hits before.
>
> # cat /etc/make.conf
> WITH_CCACHE_BUILD=
>

​You need to actually set this to a value, in order for the variable to be
defined.

WITH_CCACHE_BUILD=yes
WITH_CCACHE_BUILD=something
WITH_CCACHE_BUILD=whatever

It doesn't matter what it's set to, but it has to be set to something.​




> ​
>  # svn diff /usr/src/share/mk/local.init.mk
> Index: /usr/src/share/mk/local.init.mk
> ===================================================================
> --- /usr/src/share/mk/local.init.mk     (revision 289627)
> +++ /usr/src/share/mk/local.init.mk     (working copy)
> @@ -38,3 +38,37 @@
>  HOST_CFLAGS+= -DHOSTPROG
>  CFLAGS+= ${HOST_CFLAGS}
>  .endif
> +
> +# Handle ccache after CC is determined.  If CC is at some specific path
> then
> +# we must prepend the ccache wrapper.  Otherwise we can just prepend PATH
> with
> +# the wrapper location, which is a more safe solution since it avoids
> spaces
> +# and compiler type guessing based on filename.
> +LOCALBASE?=            /usr/local
> +CCACHE_WRAPPER_PATH?=  ${LOCALBASE}/libexec/ccache
> +CCACHE_PATH?=          ${LOCALBASE}/bin/ccache
> +.if defined(WITH_CCACHE_BUILD) && !defined(NOCCACHE) && \
>

​This line here checks if the variable is defined (meaning, that it is set
to something), and if it is, then the code after it enabled CCACHE.​

-- 
Freddie Cash
fjwcash@gmail.com



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