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=C3=B3n Molina Menor <listjm@club.=
fr>
wrote:

> Hi!
>
> I=E2=80=99m certainly doing it wrong, because CCACHE does not kick in aft=
er
> 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=3D
>

=E2=80=8BYou need to actually set this to a value, in order for the variabl=
e to be
defined.

WITH_CCACHE_BUILD=3Dyes
WITH_CCACHE_BUILD=3Dsomething
WITH_CCACHE_BUILD=3Dwhatever

It doesn't matter what it's set to, but it has to be set to something.=E2=
=80=8B




> =E2=80=8B
>  # svn diff /usr/src/share/mk/local.init.mk
> Index: /usr/src/share/mk/local.init.mk
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- /usr/src/share/mk/local.init.mk     (revision 289627)
> +++ /usr/src/share/mk/local.init.mk     (working copy)
> @@ -38,3 +38,37 @@
>  HOST_CFLAGS+=3D -DHOSTPROG
>  CFLAGS+=3D ${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 PAT=
H
> with
> +# the wrapper location, which is a more safe solution since it avoids
> spaces
> +# and compiler type guessing based on filename.
> +LOCALBASE?=3D            /usr/local
> +CCACHE_WRAPPER_PATH?=3D  ${LOCALBASE}/libexec/ccache
> +CCACHE_PATH?=3D          ${LOCALBASE}/bin/ccache
> +.if defined(WITH_CCACHE_BUILD) && !defined(NOCCACHE) && \
>

=E2=80=8BThis 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.=E2=80=
=8B

--=20
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>