buildworld, buildkernel, and devel/cache

Scott Bennett bennett at sdf.org
Mon Jan 26 18:43:40 UTC 2015


On Mon., 27 January 2015, Warren Block <wblock at wonkity.com> wrote:
> On Mon, 26 Jan 2015, Scott Bennett wrote:
> >     On Mon, 26 Jan 2015 10:24:22 +0200 Ivan Klymenko <fidaj at ukr.net> wrote:
> >>> In /root/.profile I have
> >>>
> >>> CCACHE_DIR=/buildwork/ccache
> >>> 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.


                                  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         *
**********************************************************************


More information about the freebsd-questions mailing list