From: Daan De Meyer Date: Tue, 25 Mar 2025 21:13:42 +0000 (+0100) Subject: Don't cache the package manager used in the tools tree cache manifest X-Git-Tag: v26~298 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c507eaa39ef14d9a9cc4812deafbab9e80905beb;p=thirdparty%2Fmkosi.git Don't cache the package manager used in the tools tree cache manifest Doing this causes issues when using mkosi sandbox as have_cache(tools) will be different inside and outside of the sandbox when building Fedora and only dnf is available outside the sandbox but dnf5 is available inside the sandbox. Since we don't need to cache the package manager used anyway when building the default tools tree because we don't cache the package manager metadata either, don't cache it to avoid this problem. --- diff --git a/mkosi/config.py b/mkosi/config.py index b532de02a..b28f7bef5 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -2251,7 +2251,16 @@ class Config: "release": self.release, "mirror": self.mirror, "architecture": self.architecture, - "package_manager": self.distribution.package_manager(self).executable(self), + # Caching the package manager used does not matter for the default tools tree because we don't + # cache the package manager metadata for the tools tree either. In fact, it can cause issues as + # the cache manifest for the tools tree will sometimes be different depending on whether we're + # running inside or outside of the mkosi sandbox. To avoid these issues, don't cache the package + # manager used in the tools tree cache manifest. + **( + {"package_manager": self.distribution.package_manager(self).executable(self)} + if self.image != "tools" + else {} + ), "packages": sorted(self.packages), "build_packages": sorted(self.build_packages), "package_directories": [