From 54cb8cec8c27fd2cf3faf70cff2e517a3de37790 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 30 Sep 2024 11:14:30 -0700 Subject: [PATCH] backend/ninja: allow cleandead with dyndeps and ninja >= 1.12 I fixed the upstream issue here, so if we have >= 1.12 we don't need to worry about the dyndeps issue. See: https://github.com/ninja-build/ninja/pull/2406/ --- mesonbuild/backend/ninjabackend.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 6eb1f1d01..675248962 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -692,7 +692,9 @@ class NinjaBackend(backends.Backend): mlog.cmd_ci_include(outfilename) # For CI debugging # Refresh Ninja's caches. https://github.com/ninja-build/ninja/pull/1685 # Cannot use when running with dyndeps: https://github.com/ninja-build/ninja/issues/1952 - if mesonlib.version_compare(self.ninja_version, '>=1.10.0') and os.path.exists(os.path.join(self.environment.build_dir, '.ninja_log')) and not self._uses_dyndeps: + if ((mesonlib.version_compare(self.ninja_version, '>= 1.12.0') or + (mesonlib.version_compare(self.ninja_version, '>=1.10.0') and not self._uses_dyndeps)) + and os.path.exists(os.path.join(self.environment.build_dir, '.ninja_log'))): subprocess.call(self.ninja_command + ['-t', 'restat'], cwd=self.environment.build_dir) subprocess.call(self.ninja_command + ['-t', 'cleandead'], cwd=self.environment.build_dir) self.generate_compdb()