rosrust
rosrust copied to clipboard
Building with ros_comm in catkin_ws fails on test_rosmaster::String
When I have ros_comm in my catkin_ws building with rosrust fails with:
...
| function or associated item `new` not found for this
| function or associated item not found in `test_rosmaster::String`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `new`, perhaps you need to implement one of them:
candidate #1: `error_chain::ChainedError`
candidate #2: `gimli::read::lookup::PubStuffEntry`
candidate #3: `aho_corasick::Transitions`
candidate #4: `rand::distributions::uniform::UniformSampler`
candidate #5: `error_chain::ChainedError`
test_rosmaster::String is built by ros_comm by default in devel, it doesn't get installed.
This docker command replicates it:
docker run --rm -it ros:noetic-robot bash -c "\
apt update && \
apt install -y curl git && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
source /root/.cargo/env && \
source /opt/ros/noetic/setup.bash && \
mkdir catkin_ws/src -p && \
cd catkin_ws/src && \
git clone https://github.com/ros/ros_comm.git && \
cd .. && \
catkin build && \
source devel/setup.bash && \
cd .. && \
git clone https://github.com/adnanademovic/rosrust.git && \
cd rosrust && \
cargo build"
I've tried a few variations on not building the test_rosmaster messages at all but it's odd because the generated rosrust::rosmsg_include!(...
ends up including them anyway and fails the same way. It even finds messages completely outside of the sourced workspace in a separate development workspace (but within my $HOME), rosmsg list won't show the messages as expected but rosrust_msg still finds them. Using a catkin install process didn't help. I can document that better in a separate issue with docker commands to reproduce.
This looks similar to https://github.com/adnanademovic/rosrust/issues/134
I've got additional less organized notes here https://github.com/lucasw/rust_test/issues/1
I can confirm this.