-
Notifications
You must be signed in to change notification settings - Fork 136
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
Swapped usage of rosidl_cmake over to the new rosidl_pycommon. #297
Swapped usage of rosidl_cmake over to the new rosidl_pycommon. #297
Conversation
As of [rosidl 3.3.0](ros2/rosidl@9348ce9), the rosidl_cmake Python module was moved to a new rosidl_pycommon package and the Python module in rosidl_cmake was deprecated.
rosidl_generator_rs/package.xml
Outdated
@@ -13,7 +13,8 @@ | |||
<buildtool_depend>rosidl_runtime_rs</buildtool_depend> | |||
|
|||
<buildtool_export_depend>ament_cmake</buildtool_export_depend> | |||
<buildtool_export_depend>rosidl_cmake</buildtool_export_depend> | |||
<buildtool_export_depend condition="$ROS_DISTRO != rolling">rosidl_cmake</buildtool_export_depend> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be interpreting REP 149 incorrectly, but to me it reads as if I should be able to use a less/greater than for ROS distros. Unfortunately that doesn't work, and the xml fails to parse. Not sure what to do if rosidl_cmake 3.3.0+ gets back ported to Humble or when Iron comes out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reads that way to me too. Did you try only >
or also >=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming back to this now, looks to only be a problem with less than operators.
Fails to parse
$ROS_DISTRO <= rolling
$ROS_DISTRO < rolling
Successfully parses
$ROS_DISTRO >= rolling
$ROS_DISTRO > rolling
Thankfully this means we can handle this a bit more concisely in the package.xml
<buildtool_export_depend condition="humble >= $ROS_DISTRO">rosidl_cmake</buildtool_export_depend>
<buildtool_export_depend condition="$ROS_DISTRO > humble">rosidl_pycommon</buildtool_export_depend>
We know this change is happening after humble (but only on rolling right now), so we can assume anything that's newer than humble will use rosidl_pycommon
@maspe36 thanks for the PR. The changes assume that We have two options here:
|
This would fit the bill for
Then in CMake we could do something a little more elegant like @esteve proposed. |
The next patch set doesn't assume this and I don't think will break when
I think eventually this may need to happen, but for now that's probably more work than its worth. Especially since we can have optional dependencies in the
Is this really better than doing the same check from the if("$ENV{ROS_DISTRO}" STRLESS_EQUAL "humble")
find_package(rosidl_cmake REQUIRED)
ament_export_dependencies(rosidl_cmake)
endif() Only benefit I see would be if it gets backported but since this is a deprecation I think @nnmm is right, this probably won't get backported. |
Look like the build is failing for the same reason mentioned here? I am able to pass this test, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding, this looks good. I'll wait a little bit before merging to give others the chance to take a look too.
@maspe36 I think you're now running into another small non-backwards-compatible change that was made in rolling: #302 (comment) I can try to fix it tonight, or you can do it in this PR – it should be easily resolved by conditionally setting the GID length to 16 on rolling where we currently have 24 hardcoded. An even cleaner solution would be to get rid of the hardcoding – I think the root of the problem is that |
@maspe36 If you rebase this onto main, CI should be green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we also need rosidl_pycommon
in rosidl_generator_rs/CMakeLists.txt
? Otherwise LGTM, but I can't merge before @esteve revisits his requested changes.
@esteve @nnmm rosidl_pycommon is a python only package, you cannot find it with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. Thanks for taking care of this, and sorry it took forever to merge!
@maspe36 thanks again for all the patience! 🙂 |
As of rosidl 3.3.0 (specifically, this commit), the rosidl_cmake Python module was moved to a new rosidl_pycommon package and the Python module in rosidl_cmake was deprecated.
This was throwing these deprecation warnings when building for rolling.