Why not cc me or even send this re: to the original thread?

On 10/20/2015 6:32 AM, Juan Ramón Molina Menor wrote:

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

 # 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 @@
+# Handle ccache after CC is determined.  If CC is at some specific path
+# 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
+# and compiler type guessing based on filename.
+LOCALBASE?=            /usr/local
+CCACHE_PATH?=          ${LOCALBASE}/bin/ccache
+.if defined(WITH_CCACHE_BUILD) && !defined(NOCCACHE) && \
+    ${CC:M*ccache*} == "" && exists(${CCACHE_PATH})
+# Handle compiler changes properly.  This avoids needing to use the
+# wrappers.
+.if ${CC:M/*} == ""
+# Can use PATH.
+.export PATH
+# Must prepend CC.
+CC:=           ${CCACHE_PATH} ${CC}
+CXX:=          ${CCACHE_PATH} ${CXX}
+CPP:=          ${CCACHE_PATH} ${CPP}
+.if defined(HOST_CC)
+.if defined(HOST_CXX)
+.if defined(HOST_CPP)

If I recover the old make.conf, CCACHE works again for a buildworld.

# cat /etc/make.conf.old
.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
.if !defined(NOCCACHE) && exists(/usr/local/libexec/ccache/world/cc)

Maybe I misconfigured CCACHE when I first installed it?

This doesn't check for a value of WITH_CCACHE_BUILD, just being defined
is enough.

I've been fixing some subtle bugs such as in the lib32 build, but
overall I've had ccache -s growing while using the patch.  If you
already have ccache in CC it won't apply it.

Are you building head from head or some other configuration?

HEAD from HEAD, updated regularly in /usr/src with SVN. Following the standard procedure for updating described in /usr/src/UPDATING. ccache installed as explained by the package message. Nothing special, really.

I’ll take some time when possible to recheck all the settings and be back to you.

Best regards,
freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to