Skip to content

Update dependencies exported by nav2_tasks.#474

Merged
2 commits merged intoros-navigation:masterfrom
nuclearsandwich:remove-ament-export-dependencies
Dec 11, 2018
Merged

Update dependencies exported by nav2_tasks.#474
2 commits merged intoros-navigation:masterfrom
nuclearsandwich:remove-ament-export-dependencies

Conversation

@nuclearsandwich
Copy link
Contributor

@nuclearsandwich nuclearsandwich commented Dec 11, 2018


Basic Info

Info Please fill out this column
Ticket(s) this addresses Failing package builds on build.ros2.org
Primary OS tested on Ubuntu Bionic
Robotic platform tested on none

Description of contribution in a few bullet points

This change attempts to address build failures of packages which depend on nav2_tasks.
The nav2_tasks CMake currently exports dependencies that are not declared as build_export_depend in its package.xml. I'm not familiar with the nav2_tasks package but a cursory inspection suggests it doesn't need to be exporting these dependencies.

Exporting dependencies is not required in all situations.
The documentation escapes me right now but exporting dependencies is
used for:

  • Dependencies whose C/C++ types will be present in your package's
  • Dependencies whose interfaces will be encountered by your package's
    dependents.
  • Build dependencies of code generated by your package which will be
    built during a downstream package's build.

I removed this export because I couldn't see at a glance any of the above cases for any dependency of nav2_tasks. But the final decision is best left to the maintainers. Any packages that do need to be exported need an accompanying build_export_depend in the package.xml manifest.


Future work that may be required in bullet points

  • Examine the package more closely to determine if any of the dependencies should be exported and update both CMakeLists.txt and package.xml to support that.

@nuclearsandwich
Copy link
Contributor Author

I've edited the PR description to (hopefully) be a bit more detailed and clear about what the problem is and how this tries to solve it.

@mkhansenbot
Copy link
Collaborator

@nuclearsandwich - Thanks for the explanation. Coincidentally, our Travis build is failing for a different reason, so I'm trying to get that one fixed before merging this one. Should be very soon.

@orduno orduno requested review from mjeronimo and orduno December 11, 2018 17:56
@orduno
Copy link
Contributor

orduno commented Dec 11, 2018

Adding @mjeronimo since he is also a maintainer

@mkhansenbot
Copy link
Collaborator

@nuclearsandwich - can you rebase and re-push now that Travis is passing again on master? I want to make sure my fix and your fix both work before merging

@mkhansenbot mkhansenbot self-requested a review December 11, 2018 18:17
Exporting dependencies is not required in all situations.

The documentation escapes me right now but exporting dependencies is
used for:
  * Dependencies whose C/C++ types will be present in your package's
  * Dependencies whose interfaces will be encountered by your package's
  dependents.
  * Build dependencies of code generated by your package which will be
  built during a downstream package's build.
@nuclearsandwich nuclearsandwich force-pushed the remove-ament-export-dependencies branch from 5de3145 to a4938a9 Compare December 11, 2018 18:17
Copy link
Collaborator

@mkhansenbot mkhansenbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other comment regarding rebasing

@ghost ghost mentioned this pull request Dec 11, 2018
Copy link
Contributor

@orduno orduno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exporting at least one of the dependencies causes a build error on nav2_bt_navigator. See my comment for a suggestion.


ament_export_include_directories(include)
ament_export_libraries(${library_name})
ament_export_dependencies(${dependencies})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nuclearsandwich Thanks for pointing this out. We do need to export at least tf2_geometry_msgs. It is a dependency of spin_action.hpp and is required downstream when building nav2_bt_navigator. A better approach for now:

ament_export_dependencies(tf2_geometry_msgs)

And as you suggested, add it to the package.xml:

build_export_depend(tf2_geometry_msgs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll implement this now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orduno why don't you just add tf2_geometry_msgs to the package xml in bt navigator rather than making it the tasks package's problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't you just add tf2_geometry_msgs to the package xml in bt navigator rather than making it the tasks package's problem?

If this package is publishing messages provided by another package, such that any package which consumes this one will need those messages, I think exporting the dependency here is a valid thing to do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, @orduno can you do an exhaustive search to see if there's any others we're missing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nuclearsandwich should we more generally be removing these ament export dependencies? They're broadly used right now https://github.com/ros-planning/navigation2/search?q=ament_export_dependencies&unscoped_q=ament_export_dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we more generally be removing these ament export dependencies? They're broadly used right now https://github.com/ros-planning/navigation2/search?q=ament_export_dependencies&unscoped_q=ament_export_dependencies

Good catch! Each of those should definitely be looked at, ideally by someone familiar with the package to determine whether exported packages are actually needed by downstream or not. Those that aren't can be removed and those that are can be audited to make sure there's a corresponding build_export_depend in the package.xml.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. We kind of took a blunt hammer approach and exported everything in many cases, and apparently didn't do it right (need the build_export_depend). But I don't think we should remove it altogether.

Without the ament_export_dependencies line, somebody will be forced to manually figure out all the build failures they'll get whenever they include a header from one of our packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we're saying to remove them altogether as much as audit them and make sure we've resolved this issue as made famous by rosidl

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's followup on #477.

@nuclearsandwich nuclearsandwich changed the title Remove (possibly) unnecessary ament_export_dependencies. Update dependencies exported by nav2_tasks. Dec 11, 2018
@ghost ghost merged commit 6560adb into ros-navigation:master Dec 11, 2018
@orduno orduno mentioned this pull request Dec 11, 2018
8 tasks
@nuclearsandwich nuclearsandwich deleted the remove-ament-export-dependencies branch December 11, 2018 19:23
mini-1235 pushed a commit to mini-1235/navigation2 that referenced this pull request Feb 5, 2025
This pull request was closed.
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.

4 participants