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

Static type support for rosidl_typesupport_c #110

Open
wants to merge 4 commits into
base: rolling
Choose a base branch
from

Conversation

pablogs9
Copy link
Member

@pablogs9 pablogs9 commented May 14, 2021

Hello @sloretz and @clalancette,

here at micro-ROS, we are wondering if it is possible to implement the changes proposed here to allow rosidl_typesupport_c to have some kind of statically linked typesupport dispatch for those environments where dynamic library are not allowed (embedded).

Can we discuss this feature here? What are your opinions?

CC: @ralph-lange @JanStaschulat

@pablogs9 pablogs9 force-pushed the feature/static_typesupport branch 9 times, most recently from 7ba5ffc to 897c820 Compare May 14, 2021 10:52
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think this would be a fine feature to have.

I do have some concerns about the implementation. In no particular order:

  1. The #ifdef in type_support_dispatch.hpp looks pretty ugly. It seems to me that it would be better to split the code underneath the #ifdef into a separate file (dynamic_support_dispatch.hpp or something), and then just call out to it as appropriate.
  2. The new flag to CMakeLists.txt (ROSIDL_TYPESUPPORT_STATIC_TYPESUPPORT) look somewhat redundant with the ${rosidl_typesupport_c_LIBRARY_TYPE}" STREQUAL "STATIC" code. Is there any way to combine that logic together?
  3. Similarly, the logic in the empy files feels like it would apply in both the old "STATIC" case and the new "ROSIDL_TYPESUPPORT_STATIC_TYPESUPPORT" case, but I may be misunderstanding something here.

@sloretz any thoughts here?

Signed-off-by: Your Name <you@example.com>

Default to OFF

Signed-off-by: Your Name <you@example.com>

Linter

Signed-off-by: Your Name <you@example.com>

Fix

Signed-off-by: Your Name <you@example.com>

Refactor

Reafactor

Signed-off-by: Your Name <you@example.com>

Lint

Signed-off-by: Your Name <you@example.com>
@pablogs9 pablogs9 force-pushed the feature/static_typesupport branch 6 times, most recently from dca8e1e to cab5a95 Compare May 17, 2021 08:39
Signed-off-by: Your Name <you@example.com>

Inferring flags from build type

Signed-off-by: Your Name <you@example.com>

Remove extra include

Signed-off-by: Your Name <you@example.com>

Update

Fix rebase

Signed-off-by: Your Name <you@example.com>

Fixes

Add messages

Update

Fix

Fix

Messages

Update

Linter

Lint

Remove messages

Signed-off-by: Your Name <you@example.com>
@pablogs9 pablogs9 force-pushed the feature/static_typesupport branch from cab5a95 to cdbd44d Compare May 17, 2021 08:40
@pablogs9
Copy link
Member Author

Hello @clalancette, thanks a lot for your comments. I'm answering here:

  1. I have created dynamic_support_dispatch.hpp with the logic associated to the dynamic library handling
  2. I have found that by default, at least in the tests, BUILD_SHARED_LIBS is not set, so this line is reached and probably the rosidl_typesupport_c library is being built as a static one. At some point, the build type (static or dynamic) of the rosidl_typesupport_c does not determine if the actual typesupport is being handled statically or dynamically. If fact a static library can use rcutils functions to search and use the dynamic library of the typesupport for a message.
    So, although I have modified it to use this flags, I wonder if we should keed the original option(ROSIDL_TYPESUPPORT_STATIC_TYPESUPPORT "Enable static typesupport" OFF)
  3. Sorry I don't understand which are the "empy files". Could you explain this comment?

Signed-off-by: Your Name <you@example.com>
@pablogs9 pablogs9 force-pushed the feature/static_typesupport branch from 05738c1 to be9c031 Compare May 21, 2021 11:38
@clalancette clalancette self-assigned this Feb 3, 2022
@audrow audrow changed the base branch from master to rolling June 28, 2022 14:24
@bjsowa
Copy link

bjsowa commented Aug 16, 2024

@clalancette Could you please recheck this PR?

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

Successfully merging this pull request may close these issues.

3 participants