-
Notifications
You must be signed in to change notification settings - Fork 42
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
Compile only necessary packages to speed up compilation #53
Comments
Hi. We have this though I realize it is not well documented. You can see a note about it under "building with cargo" here. It is just a crude filter so it does not know about dependencies, so if you have nested message types you need to explicitly include all of the packages you use. If you use the colcon way of building it will also only build the requested packages. I hope this helps. |
How does r2r discover requested packages when using colcon? Just curious. |
Sorry that made it sound like getting the requested packages is automatic, it is not. If you check the # put ros package dependencies here.
r2r_cargo(std_msgs # just to test that it works
rcl # we need the c ros2 api
rcl_action # as of r2r 0.1.0, we also need the action api
r2r_minimal_node_msgs # our custom message types
) Then the One improvement would of course be to get the needed packages from package.xml instead of doing it manually. But I think this works well enough, and iirc you also have to include the cmake dependencies manually when using c++. |
Thanks for your explanation. This feature should be well documented in README. It helps reducing lots of compilation time. |
Added to readme as per your suggestion, thanks. |
Currently, r2r compiles all discovered message types, which leads to a lengthy compilation time.
The idea is to let r2r acknowledge required ROS packages in
package.xml
(orCargo.toml
), and compile necessary packages.The tricky part is to allow
r2r
to learn requested packages from dependent crates. It is usually done by feature flags or environment variables. A relevant discussion can be found here rust-lang/cargo#4121.The text was updated successfully, but these errors were encountered: