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

rosidl_runtime_rs differences between main and crate breaks colcon build #303

Open
texhnolyze opened this issue Feb 27, 2023 · 3 comments
Open

Comments

@texhnolyze
Copy link

texhnolyze commented Feb 27, 2023

Hi so I tried to get this up and running to test out integrating it with our existing ros codebase and ran into the following issue:
It seems the removal of libc (#284) and thus change of the get_type_support to return *const std::os::raw::c_void leads to the build breaking:
image

After some investigation this is only due to the latest release 0.3.1 installed from crates.io not having this change yet.
As such this is only an issue during local development on the main branch and might just be due to my limited knowledge of rust/cargo.
However it was very confusing for me that rosidl_runtime_rs is downloaded and is used instead of the local one built with colcon build.
The section in the documentation does not seem up to date. As I understand the rosidl_runtime_rs crate did not use to exist?
By changing Cargo.toml of rclrs to use rosidl_runtime_rs = { version = 0.3, path = "../rosidl_runtime_rs" } I'm able to build with both colcon build as well as cargo build.

Would this be the correct way to fix this? As I take it from the docs this lead to issues in the past, due to colcon utilzing the name of packages as identifier?
I'm happy to do a PR with documenation and/or other changes if you could point me to the correct way to address this problem.

@texhnolyze texhnolyze changed the title rosidl_runtime_rs differences between main and crate release breaks local colcon build rosidl_runtime_rs differences between main and crate breaks colcon build Feb 27, 2023
@nnmm
Copy link
Contributor

nnmm commented Mar 1, 2023

Thanks for the report! I'm trying to understand how the two versions got mixed – could you tell me how you depend on rclrs in your project (i.e. do you have a checkout of the repo, or through crates.io? And how is rclrs referenced in your Cargo.toml?)? And what is listed for rclrs and rosidl_runtime_rs in ~/.cargo/config.toml?

@texhnolyze
Copy link
Author

Ok while typing the answer I realized that you were talking about ~/.cargo/config.toml.
As colcon creates a bunch of files/folders I have its own folder as a workspace under ~/colcon_ws resulting in the patch configuration for the path of rosidl_runtime_rs ending up in ~/colcon_ws/.cargo/config.toml and not being applied.
Copying the file to the correct folder in the homedir fixes the issue.
I suppose in this case it is more an issue with colcon-ros-cargo?
Looking at the code it the .cargo/config.toml is place in the working directory https://github.com/colcon/colcon-ros-cargo/blob/main/colcon_ros_cargo/task/ament_cargo/build.py#L100.
So I guess it not working is maybe due to the execution directory of cargo in the colcon build, as according to the docs if it is executed in the working dir the configuration should be applied.
Unless passing --manifest-path or --target-dir here change that.

Anyway it seems to not be an issue with ros2_rust.
@nnmm I saw that you are also maintaining colcon-ros-cargo.
I'm happy to open an issue there and do a PR if you could point me in the right direction.

@texhnolyze
Copy link
Author

After a quick search, this might even be just a bug in cargo itself rust-lang/cargo#2930

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

No branches or pull requests

2 participants