Skip to content

Commit

Permalink
Check if tools tree exists before statting it in cache_manifest()
Browse files Browse the repository at this point in the history
The tools tree might have been removed because it's cache was out of
date so let's make sure we check it exists in cache_manifest().
  • Loading branch information
DaanDeMeyer committed Oct 10, 2024
1 parent c1c3d02 commit 2469e6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mkosi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,11 @@ def cache_manifest(self) -> dict[str, Any]:
base64.b64encode(script.read_bytes()).decode() for script in self.prepare_scripts
),
# 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 [],
"tools_tree": (
[self.tools_tree, self.tools_tree.stat().st_mtime_ns]
if self.tools_tree and self.tools_tree.exists()
else []
),
}

def to_dict(self) -> dict[str, Any]:
Expand Down

0 comments on commit 2469e6d

Please sign in to comment.