-
Notifications
You must be signed in to change notification settings - Fork 45
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
Build error when using ament_python_install_package() and generated interfaces #141
Comments
This issue is blocking packaging of rosbridge_suite for rolling (RobotWebTools/rosbridge_suite#661). @clalancette @jacobperron Any ideas how the issue can be resolved? Has any progress been made on it yet? |
I would say the easiest workaround is to split the Python code and the message generation into two separate packages. You generally want to do that anyway; a downstream client may want to communicate using your custom messages, but may not want/need the other code that comes along with it. |
@jtbandes This dropped off my radar, sorry for the late reply.
I would expect the error to appear for both packages. I'm guessing it has something to do with the package.xml; there's a discrepancy between the package.xml of rosbridge_library and rosapi. Notably, rosbridge_library does not declare itself as an interface package (ie. with
I think this is doable. Though, since #131, I think the main issue is now we risk install collisions between
I'm not really sure how to proceed. Maybe we provide an option for users install multiple Python packages with the same name? We could try to detect actual install collisions and error in that case. I don't think anyone has looked into this or proposed other options. I worked around the issue originally by creating a separate package for my interfaces 🤷
I think this is what Rolling is meant for: allow maintainers to build/test against the latest changes and fix things in preparation for the next ROS release. You could setup a CI job for your repo that builds against Rolling. I suggest using our Debian testing repository to avoid having to wait for the next Rolling sync (instructions here). |
Another workaround to consider is renaming your Python package such that it does not match the package name. |
I've made a PR to split up the packages: RobotWebTools/rosbridge_suite#665 Since some of these msgs were used in tests only, I called that package |
If you are talking about the buildfarm at https://build.ros2.org, then no, this won't work. Anything the tests depend on need to be released onto the buildfarm. I can think of at least 2 ways to fix this:
We do the second thing for https://github.com/ros2/system_tests . It is never released into a distribution, but we run tests with it nightly from https://ci.ros2.org . |
Thanks for the info!
Aren't the tests running from an environment that was built on the buildfarm? As long as the test_msgs package is in the same repo, it will be checked out and built with |
No, that's not how the buildfarm works. In short, the buildfarm doesn't use colcon at all. It only checks out the specific sources for the package that is building, and installs all other dependencies in the package.xml via debian packages. So if a dependency isn't released, it won't have built a debian package and thus won't be available to satisfy the dependency. |
Ok, that makes sense. It seems like the easiest thing to do is release the |
That will certainly work. I prefer approach 2 that I pointed out above, in that you aren't releasing "useless" (to end users) packages into the ROS distribution. But it's a relatively minor point so whatever is easier for you is fine. |
My concern with 2 is that the tests won't run at all on the build farm. I imagine this means it would be possible for a change in another package to break rosbridge_server, but we wouldn't notice until after the release when things fail at runtime. |
Yeah, that's true. We're generally relying on https://ci.ros2.org to discover that for us before it ever gets to the buildfarm, and you could do a similar thing with a GitHub Action. But it is additional infrastructure you have to maintain. Either way is fine. |
…; enable Rolling in CI (#665) **Public API Changes** The msg and srv interfaces under `rosapi` are moving to a new package `rosapi_msgs`. The ones from `rosbridge_library` were used only for testing and are moving to a new package `rosbridge_test_msgs`. **Description** Fixes #581. Closes #602. Due to a [change](ros2/rosidl_python#131) in rosidl_python, the generated python packages containing msg classes were conflicting with the python package these libraries export (ros2/rosidl_python#141). The solution recommended in that thread was to split these definitions into separate packages.
Yes! This fell off my radar completely. To solve this, perhaps we can rehash |
@hidmic If I understand your proposal, this still puts the responsibility on the user to avoid install collisions if they are installing interfaces and custom Python code to the same module. It still sounds like an improvement though. |
To the extent that user provided and generated |
Can we add a warning on the tutorial that this isn't supported? |
Sure, please feel free to open a PR there and we'd be happy to review. |
* Also link out to combined C++/Python in the "Developing a ROS2 Package" as it's a valid third option Signed-off-by: Ryan Friedman <[email protected]>
* Also link out to combined C++/Python in the "Developing a ROS2 Package" as it's a valid third option Signed-off-by: Ryan Friedman <[email protected]>
* Also link out to combined C++/Python in the "Developing a ROS2 Package" as it's a valid third option Signed-off-by: Ryan Friedman <[email protected]>
… the same project (#2882) * Add warning as recommended in ros2/rosidl_python#141 Signed-off-by: Ryan Friedman <[email protected]> * Move warning to after ament_python_install_package instructions Signed-off-by: Ryan Friedman <[email protected]>
… the same project (#2882) * Add warning as recommended in ros2/rosidl_python#141 Signed-off-by: Ryan Friedman <[email protected]> * Move warning to after ament_python_install_package instructions Signed-off-by: Ryan Friedman <[email protected]> (cherry picked from commit 030bc61)
… the same project (#2882) * Add warning as recommended in ros2/rosidl_python#141 Signed-off-by: Ryan Friedman <[email protected]> * Move warning to after ament_python_install_package instructions Signed-off-by: Ryan Friedman <[email protected]> (cherry picked from commit 030bc61)
… the same project (#2882) * Add warning as recommended in ros2/rosidl_python#141 Signed-off-by: Ryan Friedman <[email protected]> * Move warning to after ament_python_install_package instructions Signed-off-by: Ryan Friedman <[email protected]> (cherry picked from commit 030bc61)
… the same project (#2882) (#2971) * Add warning as recommended in ros2/rosidl_python#141 Signed-off-by: Ryan Friedman <[email protected]> * Move warning to after ament_python_install_package instructions Signed-off-by: Ryan Friedman <[email protected]> (cherry picked from commit 030bc61) Co-authored-by: RFRIEDM-Trimble <[email protected]>
… the same project (#2882) (#2970) * Add warning as recommended in ros2/rosidl_python#141 Signed-off-by: Ryan Friedman <[email protected]> * Move warning to after ament_python_install_package instructions Signed-off-by: Ryan Friedman <[email protected]> (cherry picked from commit 030bc61) Co-authored-by: RFRIEDM-Trimble <[email protected]>
… the same project (#2882) (#2969) * Add warning as recommended in ros2/rosidl_python#141 Signed-off-by: Ryan Friedman <[email protected]> * Move warning to after ament_python_install_package instructions Signed-off-by: Ryan Friedman <[email protected]> (cherry picked from commit 030bc61) Co-authored-by: RFRIEDM-Trimble <[email protected]>
I have this issue in hmmm, it seems we must separate python package and message package. If I must split the package, the users have to change all the message name, which is a big change. |
Currently, yes, due to this bug.
Yes, this bug should be fixed. Someone has to find the time to do it. |
I made a hotfix #187. |
Contains the message definitions from ros_vosk, allowing them to be compiled using ament_cmake and used with ROS2, with or without the ros2_vosk package. Updates for ROS2 involved changing: * time to builtin_interfaces/Time, * isSpeech_recognised to is_speech_recognised and * speech_recognition.msg to SpeechRecognition.msg The reason a separate package is used is that ROS2 can not have custom message definitions in the same project that installs python modules. See ros2/rosidl_python#141 for more details. Author: Adrian Grigo
Fix compilation error. Using rosidl_generate_interfaces and ament_python_install_package does not work. See ros2/rosidl_python#141
Any progress on this? This is still a huge issue. Propose we merge @knorth55 hotfix 187 unless work is being done to fix the bug. |
+1 would be helpful to have this fixed. |
+1 would be great if this bug is fixed. |
So we discussed this bug a bit. The most For whatever reason, What I'm going to do here is to close this issue (and related PR) in favor of ament/ament_cmake#514 (partially because GitHub doesn't allow us to transfer issues between organizations). Then we can continue the conversation over there (I'll also replicate this comment there). |
Originally posted by @jacobperron in #131 (comment):
I'm running into this issue in rosbridge_suite as well when building for Rolling: RobotWebTools/rosbridge_suite#581
One thing I don't understand is why this error appears for rosapi, but not rosbridge_library.
I'm a CMake noob, but would it be possible to simply pass a different, unique target name on this line instead of just
${PROJECT_NAME}
?rosidl_python/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake
Lines 123 to 125 in 191a143
(Meta-question: is there anything we could have done in either the rosbridge_suite repo or this repo to catch this kind of failure sooner, and not have to wait for another Rolling release to incorporate a fix into rosbridge_suite? Asking because I'm still learning about the release process, having recently taken on some maintenance of rosbridge_suite for ROS 2 compatibility.)
The text was updated successfully, but these errors were encountered: