From nobody Tue Apr 04 01:48:30 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pr9dv25L4z43fFd for ; Tue, 4 Apr 2023 01:48:35 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pr9dv1WGVz3w4P; Tue, 4 Apr 2023 01:48:35 +0000 (UTC) (envelope-from leres@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680572915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jy6El8lwX7wvpzAnQ/l9k1uzkeC4ATVagA5bFP6/5cI=; b=qhx5q/2MxvyPH9iKYdktfSDWQ1wxMMjNfJIIB7Ri1Os4fEN5zxua40kCEmWRabCfhyNV1X DZ3n+WRKPERj/GiE7MIdN+aXlwtKfzoEip8yRnvSjvNyh2/zBn8ZRs3OqnoAaUaRFC9Kiu fmMD2NSd49SE4kuPj1Md+LzsD99qBGQNatyquHXsd1mx+/J/NwOEEJkP3TiiaENic49FIh piVlYgNIfc+dOWCgXKlCeAyGInG8KyDJBU45lTl+u8lJ9emfNmyJzOL40NvWmR5tIj0AcV n4DbrvbDskF8RB+tXjAu5olbO/UQmCGHJRlPlOUfuKqlwXUs2j6qDbYr8BWUOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680572915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jy6El8lwX7wvpzAnQ/l9k1uzkeC4ATVagA5bFP6/5cI=; b=UsqHIBQptZO0cbEgidfuXhGnc/qw1P5MmtF7vY4+bIBwLHEtL1o/nytQW0/pMzEjg5LX2r utvasdX8ScYte5eg9Lfpg3cGlnz2Wa2M5BzoHj8BoxJ0TyvLXWC/XNcw6+kWhEtMb1LvaZ snBOwLRqI8sK0pFeS52I5Zg/TAOt25GL0RqyqGiiAAZ1+CuLbMxJfTT7xPNW+hzOc3e6rl GM102SbKoLn3cFurODEd7os7CVuIJUFAYi5zA9gtWVrITx9G9RDgluX4oDgUxPIEBFBEYv u8rItd5NE2rRG8ppOKDSpbC+EGy8UGRU2H0WcNiFrNMmnS+7Okd3+xP5BfYjBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680572915; a=rsa-sha256; cv=none; b=baeciYyT/+LIch8xOqZwVy4TXCLka22kGClUQNEYH/R+dZqmL4Nw/bjtM+eFR2acm9rwXm +oQ0+tk1l+aqXCdEYIKINrRigaWzFNZPT1PIfft8AxgKeUu4617+uMFBNoavw4VtasOm+S LlIs3d8QZVGMFwQzccyIL+CTWh+FJD0LcxIEn5wiIgAWAgAx2VeNbE2WudJnu2Sf1mUYEx g0bTAhRj/BhYYxG7ztoP97WQNJ4vha/pYuTUIe99pXllnJ8gu7ROrxW+DSSUXc4bPyIE3B WbkHcC3NqYQ1JHVH2o08g1jwF3hx9hw/+chc8Ir52ttOKiyWU9jG+IcmWZoUSQ== Received: from [IPV6:2620:83:8000:102::cb] (hot.ee.lbl.gov [IPv6:2620:83:8000:102::cb]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: leres) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Pr9dt5tL4zhYF; Tue, 4 Apr 2023 01:48:34 +0000 (UTC) (envelope-from leres@freebsd.org) Message-ID: <92bc05d9-14fc-0928-4f36-4b55815303fe@freebsd.org> Date: Mon, 3 Apr 2023 18:48:30 -0700 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: ccache Content-Language: en-US To: Bakul Shah , freebsd-hackers References: <671864AD-11F0-487B-9597-ACF28D24591B@iitbombay.org> From: Craig Leres In-Reply-To: <671864AD-11F0-487B-9597-ACF28D24591B@iitbombay.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N 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