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.
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 (