From 798f5ef17867da9e47c6819d271178eaae0fcf0f Mon Sep 17 00:00:00 2001 From: complexoctonion Date: Mon, 6 Dec 2021 10:59:43 +0100 Subject: [PATCH] Fix performance regression in build file generation Re-use any already determined rpaths for a target. Fixes #9695 --- mesonbuild/backend/backends.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index ab02ae1a1..bb04feaf3 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -748,7 +748,8 @@ class Backend: raise MesonException(f'Invalid arg for --just-symbols, {dir} is a directory.') return dirs - def rpaths_for_bundled_shared_libraries(self, target: build.BuildTarget, exclude_system: bool = True) -> T.List[str]: + @lru_cache(maxsize=None) + def rpaths_for_bundled_shared_libraries(self, target: build.BuildTarget, exclude_system: bool = True) -> 'ImmutableListProtocol[str]': paths: T.List[str] = [] for dep in target.external_deps: if not isinstance(dep, (dependencies.ExternalLibrary, dependencies.PkgConfigDependency)):