Skip to content

Report circular dependencies detected by topological_order_packages()#617

Merged
mikepurvis merged 1 commit intocatkin:masterfrom
rhaschke:master
Feb 5, 2021
Merged

Report circular dependencies detected by topological_order_packages()#617
mikepurvis merged 1 commit intocatkin:masterfrom
rhaschke:master

Conversation

@rhaschke
Copy link
Copy Markdown
Contributor

@rhaschke rhaschke commented Jul 7, 2020

When detecting circular dependencies, catkin_pkg reports them with a special entry (None, <string of packages>).
However, catkin tools didn't handle this situation yet, but assumed that the second component of the tuple is always a package instance, providing a name attribute (pkg.name):

ordered_packages = topological_order_packages(packages)
packages_by_name = {pkg.name: (pth, pkg) for pth, pkg in ordered_packages}

causing the following exception:

$ catkin list
Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 11, in <module>
    load_entry_point('catkin-tools', 'console_scripts', 'catkin')()
  File "/homes/rhaschke/src/ros/catkin_tools/catkin_tools/commands/catkin.py", line 272, in main
    catkin_main(sysargs)
  File "/homes/rhaschke/src/ros/catkin_tools/catkin_tools/commands/catkin.py", line 267, in catkin_main
    sys.exit(args.main(args) or 0)
  File "/homes/rhaschke/src/ros/catkin_tools/catkin_tools/verbs/catkin_list/cli.py", line 96, in main
    packages_by_name = {pkg.name: (pth, pkg) for pth, pkg in ordered_packages}
  File "/homes/rhaschke/src/ros/catkin_tools/catkin_tools/verbs/catkin_list/cli.py", line 96, in <dictcomp>
    packages_by_name = {pkg.name: (pth, pkg) for pth, pkg in ordered_packages}
AttributeError: 'str' object has no attribute 'name'

@v4hn
Copy link
Copy Markdown
Contributor

v4hn commented Jul 7, 2020

Thank you, I did not find the responsible code in catkin_pkg before I had figured out my problem.
A proper error message is very much appreciated!

CI failed, although I fail to find the reason for the error...

@rhaschke
Copy link
Copy Markdown
Contributor Author

rhaschke commented Jul 7, 2020

CI was failing due to code formatting. Fixed now and ready to merge, @mikepurvis or @wjwwood.

@mikepurvis
Copy link
Copy Markdown
Member

Much needed improvement, thanks.

@mikepurvis mikepurvis merged commit 1684ffc into catkin:master Feb 5, 2021
@rhaschke rhaschke deleted the master branch June 29, 2022 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants