From owner-freebsd-questions@FreeBSD.ORG Thu Jan 24 22:08:36 2008 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 C321A16A419 for ; Thu, 24 Jan 2008 22:08:36 +0000 (UTC) (envelope-from mkhitrov@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.226]) by mx1.freebsd.org (Postfix) with ESMTP id 3020513C442 for ; Thu, 24 Jan 2008 22:08:36 +0000 (UTC) (envelope-from mkhitrov@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so310565wxd.7 for ; Thu, 24 Jan 2008 14:08:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=OhVN7ENGraIKFQGcwQN7dfwt2qncLj1Jh2a132ML60Y=; b=Rr9bHNcl4g29rVxrNVcfIPm8HBbYpCttsDmrGrbivsez1/4eojPZcwnq/rdL+orRIERytY5+dV6ssZTwI9rqvLVNwapWoHgiCWwCEJ1zwbl+gvmEI54rP9qVO4jCkW2m3eOHU0sa8Gwr7ZARjyV5BOndetLmbSH7DjyLVv2bFts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jCODW/9Z8amjVaVY8RSIA4E1NZdiGUnBSOshxiviRsuTrtjfh2hj3WKrbN28m+/rdXmevtAlh8koXATj906fUnjBNIPI7WGoBphNOO/bZFUo2rLnSkRkd/IBqfP2OLZWd2KZwU1Zg/C3t5SVErS9pTAGCehTqJQMUiU4oxprUWA= Received: by 10.142.109.16 with SMTP id h16mr805504wfc.38.1201212514703; Thu, 24 Jan 2008 14:08:34 -0800 (PST) Received: by 10.142.242.11 with HTTP; Thu, 24 Jan 2008 14:08:34 -0800 (PST) Message-ID: <26ddd1750801241408w7b776c87g14b94cfa1433616a@mail.gmail.com> Date: Thu, 24 Jan 2008 17:08:34 -0500 From: "Maxim Khitrov" To: "Erik Trulsson" , "Aryeh M. Friedman" , freebsd-questions@freebsd.org In-Reply-To: <20080124210539.GA50047@owl.midgard.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4798F1D0.3090009@gmail.com> <26ddd1750801241232l51792bf3ydc02e17e4be49d6e@mail.gmail.com> <20080124210539.GA50047@owl.midgard.homeip.net> Cc: Subject: Re: speeding up buildworld/kernel 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: Thu, 24 Jan 2008 22:08:36 -0000 On Jan 24, 2008 4:05 PM, Erik Trulsson wrote: > > On Thu, Jan 24, 2008 at 03:32:18PM -0500, Maxim Khitrov wrote: > > On Jan 24, 2008 3:15 PM, Aryeh M. Friedman wrote: > > > I update my sources at least once a day and do buildworld/kernel just > > > as often... It seems some stuff that needs not be recompiled is on > > > every single run for example gcc and kerbos. I have NO_CLEAN in > > > /etc/make.conf is there anything else I can do to speed stuff up... > > > for ref here is my /etc/make.conf: > > > > > > CPUTYPE?=nocona > > > KERNCONF=MONSTER > > > NO_CLEAN= > > > NO_LPR= > > > # added by use.perl 2008-01-17 11:48:48 > > > PERL_VER=5.8.8 > > > PERL_VERSION=5.8.8 > > > > > > - -- > > > Aryeh M. Friedman > > > FloSoft Systems, Java Tool Developers > > > Developer, not business, friendly > > > http://www.flosoft-systems.com > > > > I might be wrong, but NO_CLEAN seems like a bad idea except in special > > circumstances. Install ccache, but make sure you set > > CCACHE_HASH_COMPILER environment variable to 1. That will make sure > > that the cache stays valid if the compiler executable is overwritten > > by an identical copy (as it would be on installworld). When the > > compiler changes the cache will be repopulated on the next rebuild. > > You are indeed wrong. NO_CLEAN will work fine almost all the time - except > in special circumstances. The few times it does not work one can always do > a 'make clean' by hand first. (Or even faster: 'rm -fr /usr/obj/*') > If you set WRKDIRPREFIX to some useful value you can do the same thing > for the ports tree. > Personally I always compile with -DNO_CLEAN and use 'rm -fr' to clean. > I have never had problems originating with this. > > ccache is not very useful for buildworld, since among the first thing > buildworld does is to build the compiler and then use the newly built > compiler to compile the rest. I.e. the already installed compiler (which is > the one ccache will handle) will not be used for most of the build thus > removing almost all the advantage of ccache. > It is supposed to be possible to use ccache for buildworld as well, but > that would require a bit of hackery. That's not true. I just ran `make buildworld buildkernel` on my firewall. Here are ccache stats when the operation finished: root@cerberus [/root]# ccache -s cache directory /srv/.ccache cache hit 12056 cache miss 38 called for link 461 multiple source files 1 not a C/C++ file 1228 unsupported compiler option 7 files in cache 117366 cache size 679.6 Mbytes max cache size 2.0 Gbytes Ccache is used through the entire build process and there is no hackery involved. Just follow the directions for changing the compiler to /usr/local/libexec/ccache/world-cc. On this Celeron D 1.8 GHz machine rebuilding world and kernel takes 45 minutes and 40 seconds. I don't recall exactly what it was without ccache, but I think it was around 3 hours. Just make sure that you set the CCACHE_HASH_COMPILER variable, otherwise it will assume that the compiler is different just because its modification time has changed. - Max