Re: [PATCH] ccache.bbclass: document CCACHE_MAXSIZE variable

Andre McCurdy

On Thu, May 26, 2022 at 5:06 PM Zach Welch <zach@...> wrote:

Setting this avoids premature cache object eviction during large builds.

Signed-off-by: Zachary T Welch <zach@...>
meta/classes/ccache.bbclass | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index 4532894c57..913304ab35 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -12,7 +12,12 @@
# Set CCACHE_TOP_DIR to a shared dir
# CCACHE_TOP_DIR = /path/to/shared_ccache/
-# - TO debug ccahe
+# - Adjust the ccache size limit to avoid overflow during large builds:
+# export CCACHE_MAXSIZE = "100G"
+# To find a reasonable limit, set this limit to 0 (no limit), then
+# observe how large the ccache directory grows.
The default (ie 5GB) would seem safer for most users. Apart from some
potential loss in performance, there's no downside to reaching the
limit (i.e. there's no "overflow" as you describe it) and 5GB of
compressed object code is already quite a lot. Growing much beyond
that risks just filling the cache up with old stuff that's never going
to be reused anyway.

What kind of "large builds" are you seeing issues with?

+# - To debug ccache:> # export CCACHE_DEBUG = "1"
# export CCACHE_LOGFILE = "${CCACHE_DIR}/logfile.log"
# And also set PARALLEL_MAKE = "-j 1" to get make the log in order

Join { to automatically receive all group messages.