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

Type Description Nested Support #735

Conversation

emersonknapp
Copy link
Collaborator

@emersonknapp emersonknapp commented Apr 2, 2023

Part of ros2/ros2#1159

Bundled with (must be merged together):

Replaces (or extends) #727. Key differences

  • type_support_t->get_type_hash_func rather than bare value
  • get_type_description and get_type_sources take a typesupport struct argument (for use by dynamic types)
  • Type descriptions and sources include referenced types, rather than baking in full recursive dependencies per-interface
  • Expected hashes of referenced types are included in codegen to optionally error-check with at runtime

Key features:

  • Changes TYPE_HASH_TUPLES to more accurate TYPE_DESCRIPTION_TUPLES in cmake
  • Adds new C interface functions get_type_description, get_individual_type_description_source, and get_type_description_sources
  • Implements above, generating code for type descriptions and raw interface definition sources, embedded in the binaries
  • Optionally disables embedding that information in the generated code by the CMake flag ROSIDL_GENERATOR_C_DISABLE_TYPE_DESCRIPTION_CODEGEN
  • Refactors rosidl_generator_type_description to output a new structure of type_description_msg plus a flat list of all referenced types and their hashes at the time of generation. These hashes are used at runtime (in Debug builds) to detect ABI breaks when constructing type descriptions the first time

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp emersonknapp force-pushed the emersonknapp/type-description-include-nested branch from 7e2f619 to cd15879 Compare April 2, 2023 22:29
…of date

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp
Copy link
Collaborator Author

ci_launcher ran: https://ci.ros2.org/job/ci_launcher/11761

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp
Copy link
Collaborator Author

emersonknapp commented Apr 4, 2023

Wstring encoding problem:

  • Windows Build Status

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp
Copy link
Collaborator Author

NDEBUG-guard around hash value only used for assert

  • Linux Build Status

@emersonknapp emersonknapp changed the title [WIP] Type Description Nested Support Type Description Nested Support Apr 4, 2023
@emersonknapp emersonknapp marked this pull request as ready for review April 4, 2023 16:01
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp
Copy link
Collaborator Author

Windows also needs to open(encoding='utf-8') explicitly:

  • Windows Build Status

Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@emersonknapp emersonknapp force-pushed the emersonknapp/type-description-include-nested branch from e57ee67 to f581176 Compare April 4, 2023 23:29
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
@clalancette
Copy link
Contributor

@emersonknapp I'm a bit confused here; shouldn't we close this PR in favor of #727?

@emersonknapp
Copy link
Collaborator Author

Yes - I accidentally pushed that bugfix to the wrong branch

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.

2 participants