From: Daan De Meyer Date: Tue, 28 Jan 2025 19:47:30 +0000 (+0100) Subject: Don't call have_cache() in reuse_cache() X-Git-Tag: v25.3~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3446%2Fhead;p=thirdparty%2Fmkosi.git Don't call have_cache() in reuse_cache() By the time reuse_cache() is called, we've already cleaned up old cached images if needed, so just check if they still exist and reuse them if they do. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index bb11dc991..863a72722 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -3114,10 +3114,12 @@ def have_cache(config: Config) -> bool: def reuse_cache(context: Context) -> bool: - if not have_cache(context.config): + if not context.config.incremental or context.config.base_trees or context.config.overlay: return False final, build, _ = cache_tree_paths(context.config) + if not final.exists() or (need_build_overlay(context.config) and not build.exists()): + return False with complete_step("Copying cached trees"): copy_tree(