-
Notifications
You must be signed in to change notification settings - Fork 125
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
add new macro to export ts libraries through different CMake variable #284
Conversation
https://ci.ros2.org/job/ci_packaging_osx/37/ provides a fat archive built against Connect and FastRTPS. This is this in progress since I didn't have the chance to check this in a macOS machine yet... If nobody bets me to it I will check it on Monday. If it "works" the same patch as in ros2/rmw_connext#291 needs to be applied to other vendors. |
works for me:
I can build an overlay without connext and running fastrtps nodes works, also. If I then update |
I also created a PR for OpenSplice and put the PRs in review. CI builds with all rmw to check for regressions: The "positive" effect of the changes won't be visible in the CI builds though. Both both @dhood and my checking indicates that it addresses the referenced issue. |
Were you going to make one for fastrtps? We always ship introspection typesupport so it doesn't matter much, but in theory introspection typesupport shouldn't be linked against by default either, yeah? |
For now I didn't plan to do the same for introspection since I think all places have an explicit dependency on it. Assuming you could remove FastRTPS and "everything" still works of course (same as for the other rmw impl.). |
can you clarify what sort of places are you referring to? The only thing I only found was https://github.com/ros2/rosidl_typesupport/blob/aa730a885be300c8026a435b6270ee62b910091a/rosidl_default_runtime/package.xml#L17, which is the same for static typesupports. |
Yes, that was the location I had in mind. The static typesupports are only mentioned as a workaround there (as described in the comment). To turn the question around why should we add the same to introspection ts? I don't see any immediate use case why that would be beneficial. We can always consider it later / after the release but I would keep the changes until the release as small as possible. |
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.
lgtm overall, a few questions/suggestions you might want to take before merging though.
@@ -0,0 +1,44 @@ | |||
# generated from rosidl_cmake/cmake/template/rosidl_cmake_export_typesupport_libraries.cmake.in |
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.
Copyright?
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.
Neither of the other .cmake.in
templates have copyright notes. I think that was mostly so that generated code embedded into other packages doesn't have implicitly the same copyright (e.g. if that package wants to choose a different license).
|
||
if(NOT _lib) | ||
# warn about not existing library and ignore it | ||
message(FATAL_ERROR "Package '@PROJECT_NAME@' exports the typesupport library '${_library}' which couldn't be found") |
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.
Should this be STATUS
or WARNING
or something else? Otherwise you're not going to "ignore it" as the comment says. It will stop here. I'm not sure what the behavior should be in this context.
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.
Hm, this is the same as in ament_export_libraries
: https://github.com/ament/ament_cmake/blob/409ee0403d8d1eba0dc5a58cf52dcec5eadc91d2/ament_cmake_export_libraries/cmake/ament_cmake_export_libraries-extras.cmake.in#L47-L48
I would rather not change the behavior. So I just updated the comment to match the actual behavior: 5047c44#diff-d8035aae44630fe14ea78f925e0f4effR25
ament_register_extension("ament_package" "rosidl_cmake" | ||
"rosidl_cmake_export_typesupport_libraries_package_hook.cmake") | ||
endif() | ||
endmacro() |
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.
Should this maco be here? Rather than its own file or in the rosidl_export_typesupport_libraries.cmake
file?
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.
This file is the CMake extra file of the rosidl_cmake
package. Therefore I just added it there. It could be placed into a second -extras.cmake
file but it would be rather uncommon that a single CMake package has multiple extra files.
03db54f
to
a138ed9
Compare
a138ed9
to
5047c44
Compare
I also addressed the CMake linter warnings. |
@dirk-thomas I'm sorry to ask a question on an old pull request. I noticed that this PR adds a CMake function However, in the down stream packages like Thanks. |
@left4taco Why do you need to depend on an RMW specific library in the first place? Commonly you will only need to depend on the |
@dirk-thomas The reason is that cross compiling with only RTI Connext Pro/Micro failed for not being able to find symbols defined in those DDS msg libraries. More specifically, since there's only one RMW implementation(FastRTPS is disabled),
With the changes in this PR, only the generic This works fine for native compile because for native compile,
..., which means that the linker will not search for the missing libraries in
We are using the first one since we won't ship with FastRTPS and RTI Connext Micro is a prerequisite. My whole point is that cross compiling with RMW implementation other than FastRTPS might not work. Thanks. |
@left4taco I suggest you move this topic to a new ticket since it is not obvious what the right solution for your use case would be and in this already closed ticket it will certainly get lost. |
The vendor specific typesupport libraries must not be exported through the message packages
<pkgname>_LIBRARIES
variable in order to address ros2/ros2#437.This patch provides a macro to export the typesupport libraries through a separate variable which can be used by the vendor specific packages.