From: Daan De Meyer Date: Wed, 2 Oct 2024 10:15:02 +0000 (+0200) Subject: Rework tools tree cache manifest serialization X-Git-Tag: v25~245^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b88e55c30437b398f2fc2c0985f2ca1b74bd4e21;p=thirdparty%2Fmkosi.git Rework tools tree cache manifest serialization Let's encode the full path and not just the name. We'll rework the tests in the next commit to not nuke the tools tree every time. Let's also track the timestamp of the root directory of the tools tree as a heuristic for whether it's been updated or not. --- diff --git a/mkosi/config.py b/mkosi/config.py index d422a150d..010c3047f 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -1816,13 +1816,8 @@ class Config: "prepare_scripts": sorted( base64.b64encode(script.read_bytes()).decode() for script in self.prepare_scripts ), - # We don't use the full path here since tests will often use temporary directories for the output - # directory which would trigger a rebuild every time. - "tools_tree": self.tools_tree.name if self.tools_tree else None, - "tools_tree_distribution": self.tools_tree_distribution, - "tools_tree_release": self.tools_tree_release, - "tools_tree_mirror": self.tools_tree_mirror, - "tools_tree_packages": sorted(self.tools_tree_packages), + # Statting the root directory of the tools tree isn't fool proof but should be good enough. + "tools_tree": [self.tools_tree, self.tools_tree.stat().st_mtime_ns] if self.tools_tree else [], } def to_dict(self) -> dict[str, Any]: