From: Daan De Meyer Date: Fri, 20 Dec 2024 08:56:48 +0000 (+0100) Subject: Use "tools" as the cache key for the default tools tree X-Git-Tag: v25~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb888eafc62b9385570e3b567a751a53d8ffdf4f;p=thirdparty%2Fmkosi.git Use "tools" as the cache key for the default tools tree Currently we still use "distribution~release~architecture", which breaks checking if the cache is out of date, since we'll always check against the cache of the currently configured tools tree distribution, even if we used a different tools tree distribution to build the tools tree. Let's fix this by using the same cache key for all default tools trees. This shouldn't introduce any performance regression as users are not expected to change the default tools tree distribution all the time unlike the target image distribution. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index e7201548f..aec950af7 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2394,12 +2394,15 @@ def print_output_size(path: Path) -> None: def cache_tree_paths(config: Config) -> tuple[Path, Path, Path]: - fragments = [config.distribution, config.release, config.architecture] + if config.image == "tools": + key = "tools" + else: + fragments = [config.distribution, config.release, config.architecture] - if config.image: - fragments += [config.image] + if config.image: + fragments += [config.image] - key = "~".join(str(s) for s in fragments) + key = "~".join(str(s) for s in fragments) assert config.cache_dir return (