Skip to content

Commit

Permalink
(#4319) Speedup boost recipe package_info by caching dependencies file
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbunnyru authored Jan 21, 2021
1 parent 41efa9e commit 5fca43c
Showing 1 changed file with 7 additions and 5 deletions.
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 @@ -157,10 +158,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 @@ -1321,7 +1324,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

0 comments on commit 5fca43c

Please sign in to comment.