Skip to content

Commit

Permalink
Improved error messages for circular dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
GPMueller committed Nov 16, 2019
1 parent b20000d commit 3d58a42
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions clang_build/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,14 @@ def __init__(self, config, environment, multiple_projects, is_root_project, pare

# Check this project's targets for circular dependencies
circular_dependencies = _find_circular_dependencies(self.targets_config)
error_messages = []
if circular_dependencies:
error_messages = [f'Circular dependency [{target}] -> [{dependency}]' for\
target, dependency in circular_dependencies]
for circle in circular_dependencies:
message = f'Circular dependency: ... -> [{circle[0]}]'
for target in circle[1:]:
message += f' -> [{target}]'
message += f' -> ...'
error_messages.append(message)

error_message = f"[[{self.identifier}]]:\n" + _textwrap.indent('\n'.join(error_messages), prefix=' '*3)
_LOGGER.exception(error_message)
Expand Down

0 comments on commit 3d58a42

Please sign in to comment.