From owner-freebsd-questions@FreeBSD.ORG Tue Jan 27 12:40:23 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 703BC1CB for ; Tue, 27 Jan 2015 12:40:23 +0000 (UTC) Received: from sdf.lonestar.org (mx.sdf.org [192.94.73.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx.sdf.org", Issuer "SDF.ORG" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 53F8036B for ; Tue, 27 Jan 2015 12:40:22 +0000 (UTC) Received: from sdf.org (IDENT:bennett@otaku.freeshell.org [192.94.73.9]) by sdf.lonestar.org (8.14.8/8.14.5) with ESMTP id t0RCe9Wr015805 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Tue, 27 Jan 2015 12:40:09 GMT Received: (from bennett@localhost) by sdf.org (8.14.8/8.12.8/Submit) id t0RCe9GA006605; Tue, 27 Jan 2015 06:40:09 -0600 (CST) From: Scott Bennett Message-Id: <201501271240.t0RCe9GA006605@sdf.org> Date: Tue, 27 Jan 2015 06:40:09 -0600 To: wblock@wonkity.com Subject: Re: buildworld, buildkernel, and devel/cache References: <201501261245.t0QCjUMD009768@sdf.org> <201501261843.t0QIhX78006200@sdf.org> In-Reply-To: User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2015 12:40:23 -0000 Warren Block wrote: > On Mon, 26 Jan 2015, Scott Bennett wrote: > > > On Mon., 27 January 2015, Warren Block wrote: > >> On Mon, 26 Jan 2015, Scott Bennett wrote: > >>> On Mon, 26 Jan 2015 10:24:22 +0200 Ivan Klymenko wrote: > >>>>> In /root/.profile I have > >>>>> > >>>>> CCACHE_DIR=/buildwork/ccache It occurs to me that the above line might not propagate its value down into subshells (e.g., sh(1) run by buildworld, buildkernel, etc.), so I have just now replaced it with export CCACHE_DIR=/buildwork/ccache so that, if I ever get buildworld or buildkernel to run ccache, it should find the correct cache location. > >>>>> export PATH=/usr/local/libexec/ccache:$PATH > >>>>> export CCACHE_PATH=/usr/bin:/usr/local/bin > >>>>> > >>>>> In /root/.cshrc.extensions, a file I source from /root/.cshrc, I have > >>>>> > >>>>> setenv CCACHE_DIR /buildwork/ccache > >>>>> setenv PATH /usr/local/libexec/ccache:$PATH > >>>>> setenv CCACHE_PATH /usr/bin:/usr/local/bin > >>>>> > >>>> This file is in some ways you can > >>>> help /usr/local/share/doc/ccache/ccache-howto-freebsd.txt > >>> > >>> I had read that and hadn't seen how that would work, but after seeing > >>> your reply, I tried adding the three lines to /etc/make.conf and got errors, > >>> like I had expected: > >>> > >>> make: "/etc/make.conf" line 18: Missing dependency operator > >>> make: RE substitution error: repetition-operator operand invalid > >>> make: Unclosed substitution for CXX (, missing) > >>> make: "/etc/make.conf" line 20: Undefined variable "${CXX:C,^c++,/usr/local/libexec/ccache/world/c++,1}" > >>> make: Fatal errors encountered -- cannot continue > >>> make: stopped in /usr/src > >>> > >>> So my question remains. Please respond if you have something that > >>> you have tried and know works. > >>> Thanks in advance. > >> > >> They are shell variables, so set them in the shell, .cshrc or the two > >> alternatives mentioned above. > > > > Well, the instructions in that file say, > > > > To use ccache for base add the following to /etc/make.conf. You > > can replace cc and c++ with the compilers of your choice. (re- > > member that only GCC and Clang can build world and kernel) > > > > && 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} > > > > which was why I had put those three lines into /etc/make.conf. On your > > suggestion, I moved them to /root/.profile and /root/.cshrc.extensions, > > with the results that in the csh case, I got (as expected) the > > > > Badly placed ()'s. > > > > error. sh gave no errors, so I started a buildworld, which has been running > > for a little while already, but with no evidence to be found (e.g., no > > counters increasing in "ccache -s" output, no ccache seen running in top, > > the only instances of ccache in lastcomm(1) output are the ones I entered > > manually to check the counters) that ccache is being used by buildworld at > > all. I have not yet tried any ports updates to see whether addition of > > those three lines to .profile had any adverse effect upon that process. > > Thanks for the try, though. > > I might have missed something, so let's back up. Shell variables need > to be set, and entries in make.conf need to be added. Both are needed. Yes. I guess I'm missing your point. I followed the instructions in /usr/local/share/doc/ccache/ccache-howto-freebsd.txt, which turned out to cause errors on the three lines in question from those instructions. I then followed your suggestion to move them, and that was ineffective in .profile and caused errors in .cshrc.extensions. So I don't see how those particular shell variables are to be set. The only other entry for /etc/make.conf is the entry that, by itself, is sufficient to build ports using ccache, and that, as I noted originally, was working just fine. With CCACHE_DIR set in .profile and set as an environment variable in .cshrc.extensions, ports even get built okay with ccache cacheing its data in the correct file system. (Yay!) But if there are other /etc/make.conf entries needed (but undocumented?) or other shell/environment variables needed (also undocumented?) to get buildworld and buildkernel to use ccache, the please clarify. And thanks, Walter, for your attention to this. Scott Bennett, Comm. ASMELG, CFIAG ********************************************************************** * Internet: bennett at sdf.org *xor* bennett at freeshell.org * *--------------------------------------------------------------------* * "A well regulated and disciplined militia, is at all times a good * * objection to the introduction of that bane of all free governments * * -- a standing army." * * -- Gov. John Hancock, New York Journal, 28 January 1790 * **********************************************************************