From owner-freebsd-current@freebsd.org Wed Oct 21 20:44:52 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24BA3A1BD63 for ; Wed, 21 Oct 2015 20:44:52 +0000 (UTC) (envelope-from listjm@club.fr) Received: from smtp26.services.sfr.fr (smtp26.services.sfr.fr [93.17.128.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC527F89; Wed, 21 Oct 2015 20:44:51 +0000 (UTC) (envelope-from listjm@club.fr) Received: from filter.sfr.fr (localhost [78.118.197.112]) by msfrf2603.sfr.fr (SMTP Server) with ESMTP id E3FA31C00080C; Wed, 21 Oct 2015 22:44:49 +0200 (CEST) Authentication-Results: sfrmc.priv.atos.fr; dkim=none (no signature); dkim-adsp=none (no policy) header.from=listjm@club.fr Received: from [192.168.1.51] (112.197.118.78.rev.sfr.net [78.118.197.112]) by msfrf2603.sfr.fr (SMTP Server) with ESMTP id 993C81C000435; Wed, 21 Oct 2015 22:44:47 +0200 (CEST) X-SFR-UUID: 20151021204449627.993C81C000435@msfrf2603.sfr.fr From: Juan =?iso-8859-1?b?UmFt824=?= Molina Menor Subject: Re: [CFT] Buildworld ccache support To: Bryan Drewery , freebsd-current@freebsd.org References: <56264279.7020504@club.fr> <56279AD2.6080009@FreeBSD.org> Message-ID: <5627F937.4060301@club.fr> Date: Wed, 21 Oct 2015 22:44:39 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56279AD2.6080009@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2015 20:44:52 -0000 > 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: >> 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= >> >> # 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) && \ >> + ${CC:M*ccache*} == "" && exists(${CCACHE_PATH}) >> +# Handle compiler changes properly. This avoids needing to use the >> 'world' >> +# wrappers. >> +CCACHE_COMPILERCHECK?= content >> +.export CCACHE_COMPILERCHECK >> +.if ${CC:M/*} == "" >> +# Can use PATH. >> +PATH:= ${CCACHE_WRAPPER_PATH}:${PATH} >> +.export PATH >> +.else >> +# Must prepend CC. >> +CC:= ${CCACHE_PATH} ${CC} >> +CXX:= ${CCACHE_PATH} ${CXX} >> +CPP:= ${CCACHE_PATH} ${CPP} >> +.if defined(HOST_CC) >> +HOST_CC:= ${CCACHE_PATH} ${HOST_CC} >> +.endif >> +.if defined(HOST_CXX) >> +HOST_CXX:= ${CCACHE_PATH} ${HOST_CXX} >> +.endif >> +.if defined(HOST_CPP) >> +HOST_CPP:= ${CCACHE_PATH} ${HOST_CPP} >> +.endif >> +.endif >> +.endif # WITH_CCACHE_BUILD >> >> 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) >> CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1} >> CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1} >> .endif >> .endif >> >> 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, Juan