Re: [CFT] Buildworld ccache support

From: Freddie Cash <fjwcash_at_gmail.com>
Date: Tue, 20 Oct 2015 08:50:35 -0700
On Tue, Oct 20, 2015 at 6:32 AM, Juan Ramón Molina Menor <listjm_at_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)
> _at__at_ -38,3 +38,37 _at__at_
>  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_at_gmail.com
Received on Tue Oct 20 2015 - 13:50:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:00 UTC