From b7d9a00739975986da7a43b28983197f71bb9f9d Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Wed, 20 Jan 2021 12:51:45 +0300 Subject: [PATCH] Speedup boost recipe package_info by caching dependencies file --- recipes/boost/all/conanfile.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index 57e50a88e8bb7..786247bd597ae 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -129,6 +129,7 @@ class BoostConan(ConanFile): short_paths = True no_copy_source = True exports_sources = ['patches/*'] + _cached_dependencies = None def export(self): self.copy(self._dependency_filename, src="dependencies", dst="dependencies") @@ -159,10 +160,12 @@ def _dependency_filename(self): @property def _dependencies(self): - dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependency_filename) - if not os.path.isfile(dependencies_filepath): - raise ConanException("Cannot find {}".format(dependencies_filepath)) - return yaml.safe_load(open(dependencies_filepath)) + if self._cached_dependencies is None: + dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependency_filename) + if not os.path.isfile(dependencies_filepath): + raise ConanException("Cannot find {}".format(dependencies_filepath)) + self._cached_dependencies = yaml.safe_load(open(dependencies_filepath)) + return self._cached_dependencies def _all_dependent_modules(self, name): dependencies = {name} @@ -1318,7 +1321,6 @@ def filter_transform_module_libraries(names): if requirement != self.options.i18n_backend: continue self.cpp_info.components[module].requires.append("{0}::{0}".format(conan_requirement)) - for incomplete_component in incomplete_components: self.output.warn("Boost component '{0}' is missing libraries. Try building boost with '-o boost:without_{0}'.".format(incomplete_component))