From owner-freebsd-questions@FreeBSD.ORG Mon Aug 13 05:06:31 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CE7416A418 for ; Mon, 13 Aug 2007 05:06:31 +0000 (UTC) (envelope-from illoai@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.188]) by mx1.freebsd.org (Postfix) with ESMTP id A663513C491 for ; Mon, 13 Aug 2007 05:06:30 +0000 (UTC) (envelope-from illoai@gmail.com) Received: by fk-out-0910.google.com with SMTP id b27so1577333fka for ; Sun, 12 Aug 2007 22:06:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Y3q0MbCunCxRv1TlCjQ8MIh4knW6pS/VqwHtM+k30rArZgmE1d4b77+3LImw7+KjlZ9iifKUeGw0bTNNvQ/5K1eXdTAE8vW2Ewzop3Exd76HdwrkZ9B0MnaqJMrxXhkckEN2Bs7T4vNB8yXuTgTW7NmRBycjEaNK6pB8Gv6Id3w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=m9KgJfaUH4cN5QoNg/MQff4zh5tJOj+B2wcMIeo03YIcdGkgjG5ZrO2fRC1bS8px8bXIe83GSJAKJmXCh0OdUiA8qgGNFNFqb8YUOtOflmkjskY/7DueLnkAIkHKglZHQf7K84rndSIGRBe7xbH+rUaT2xweE4FrOUlsB5SiTrY= Received: by 10.82.100.1 with SMTP id x1mr6232154bub.1186981588524; Sun, 12 Aug 2007 22:06:28 -0700 (PDT) Received: by 10.82.185.5 with HTTP; Sun, 12 Aug 2007 22:06:28 -0700 (PDT) Message-ID: Date: Mon, 13 Aug 2007 00:06:28 -0500 From: "illoai@gmail.com" To: "Maxim Khitrov" In-Reply-To: <26ddd1750708122157n70e6b832p33d378c75c8fd698@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <26ddd1750708122157n70e6b832p33d378c75c8fd698@mail.gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: ccache never "hits" on buildworld or buildkernel X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2007 05:06:31 -0000 On 12/08/07, Maxim Khitrov wrote: > Hello, > > I'm using ccache to build FreeBSD source and ports. Ports work great, > I build something once and the second time just about everything is > found in the cache. For buildworld and buildkernel, however, > everything is a miss. Even when not a single thing changed about the > configuration or the actual source files. > > Below is my make.conf configuration for ccache. Ccache is being used > via world-cc and world-c++ binaries for these two operations; I can > see the miss counter go up in 'ccache -s'. Why is it unable to > properly cache when building the source? > > Thanks. > > make.conf: > > .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) && \ > !defined(NOCCACHE) && exists(/usr/local/libexec/ccache) > CC= /usr/local/libexec/ccache/world-cc > CXX=/usr/local/libexec/ccache/world-c++ > .endif > > .if !empty(.CURDIR:M/usr/ports*) && !defined(NOCCACHE) \ > && exists(/usr/local/libexec/ccache) > CC= /usr/local/libexec/ccache/cc > CXX=/usr/local/libexec/ccache/c++ > .endif > > uname -a: > > FreeBSD -.-.- 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Sun Aug 12 15:45:05 > EDT 2007 max@-.-.-:/usr/obj/usr/src/sys/KERNEL i386 I believe ccache checks the compiler itself before issuing a "hit". Since the buildworld process rebuilds the compiler ccache thinks it's a different compiler and issues a "miss". >From man ccache: CCACHE_NOHASH_SIZE_MTIME This tells ccache to not hash the real compiler's size and modi- fication time. Normally this is the mechanism to detect compiler upgrades. There are situations however, where even though the compiler's size or modification time has changed you can safely use the cached objects (e.g. if as part of your build system the compiler is built as well and the compiler's source has not changed; or if the compiler has only changes that do not affect code generation). Use this feature only if you know what you are doing. I hope this helps? -- --