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

feature: Improve dependency-cycle error to show the cycle #11519

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion conans/model/build_info.py
Expand Up @@ -608,8 +608,15 @@ def _get_sorted_components(self):
del components[comp_name]
break
else:
dset = set()
for comp_name, comp in components.items():
for dep_name, dep in components.items():
for require in self._filter_component_requires(dep.requires):
if require == comp_name:
dset.add(" {} requires {}".format(dep_name, comp_name))
dep_mesg = "\n".join(dset)
raise ConanException("There is a dependency loop in "
"'self.cpp_info.components' requires")
"'self.cpp_info.components' requires:\n{}".format(dep_mesg))
self._sorted_components = ordered
else: # If components do not have requirements, keep them in the same order
self._sorted_components = self._cpp_info.components
Expand Down