Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup boost recipe package_info by caching dependencies file #4319

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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))

Expand Down