Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Apr 2023 18:48:30 -0700
From:      Craig Leres <leres@freebsd.org>
To:        Bakul Shah <bakul@iitbombay.org>, freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: ccache
Message-ID:  <92bc05d9-14fc-0928-4f36-4b55815303fe@freebsd.org>
In-Reply-To: <671864AD-11F0-487B-9597-ACF28D24591B@iitbombay.org>
References:  <671864AD-11F0-487B-9597-ACF28D24591B@iitbombay.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/3/23 17:09, Bakul Shah wrote:
> Am I use ccache incorrectly or is there a bug?
> 
> # CCACHE_DIR=/usr/obj/ccache ccache -s
> cache directory                     /usr/obj/ccache
> primary config                      /usr/obj/ccache/ccache.conf
> secondary config      (readonly)    /usr/local/etc/ccache.conf
> stats updated                       Mon Apr  3 16:54:31 2023
> ...
> cleanups performed                   507
> files in cache                   2795230
> cache size                           2.9 GB <===
> max cache size                      15.0 GB
> # find /usr/obj/ccache -type f |wc
>   2795395 2795395 142222206
> # du -sh /usr/obj/ccache
>   83G    /usr/obj/ccache	<===
> 
> I have
> 
> WITH_CCACHE_BUILD=yes
> CCACHE_DIR=/usr/obj/ccache
> 
> in /etc/make.conf

Thank you for bringing this up; I have the same issue and have never 
figured it out. But I think I've found another piece or two of the puzzle.

Using my favorite ktrace trick we can see that by default it tries to 
open /usr/local/etc/ccache.conf:

     zinc 32 % cd /tmp && ktrace -di ccache -s > /dev/null
     zinc 33 % kdump | fgrep NAMI | fgrep ccache.conf
      17418 ccache   NAMI  "/usr/local/etc/ccache.conf"
   17418 ccache   NAMI  "/home/zinc/u0/leres/.ccache/ccache.conf"

I suspect the trick here is when ccache runs inside a poudriere jail, 
ccache.conf is not present and/or not in the right location.

On my build server I have /var/cache/ccache/ccache.conf which I believe 
works for some things but I still have 46 GB in /var/cache/ccache and 
/var/cache/ccache/ccache.conf is trying to limit use to 8 GB.

If I start up a poudriere jail and look around I find 
/root/.ccache/ccache.conf is a copy of /var/cache/ccache/ccache.conf. So 
I don't get why it doesn't work.

(Now I'll sit back and wait for something who knows more chimes in...)

		Craig




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?92bc05d9-14fc-0928-4f36-4b55815303fe>