Skip to content

XTypes compatibility workarounds#2333

Merged
eboasson merged 3 commits intoeclipse-cyclonedds:masterfrom
eboasson:reject-invalid-try-construct-ignore-type-information
Jan 7, 2026
Merged

XTypes compatibility workarounds#2333
eboasson merged 3 commits intoeclipse-cyclonedds:masterfrom
eboasson:reject-invalid-try-construct-ignore-type-information

Conversation

@eboasson
Copy link
Contributor

@eboasson eboasson commented Jan 6, 2026

This fixes a bug in TypeObject validation by rejecting cases where "try construct" is set to 0, which is undefined. Originally Cyclone itself had this bug, but that's been fixed for several years. This changes the validation code to reject the invalid setting, but it does provide an option to accept it for compatibility with that ancient version as well as with other broken implementations.

It also turns out that type lookup is problematic with some other implementations. If all types are assignable (the normal case), then ignoring the "type information" part of the discovery data altogether (and falling back to name-based type matching) can help. So this also adds an option for that.

The latter definitely makes a big difference in letting Cyclone and Fast-DDS interoperate in the ROS 2 test suite.

These are invalid per the spec. However, Cyclone 0.9 got that wrong, as do some other
implementations. Thus there is an option to allow them.

Signed-off-by: Erik Boasson <eb@ilities.com>
@eboasson eboasson force-pushed the reject-invalid-try-construct-ignore-type-information branch from c3f132a to b87357c Compare January 6, 2026 13:39
Copy link
Contributor

@dpotman dpotman left a comment

Choose a reason for hiding this comment

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

Looks good. Just one tiny detail: the symbol export check is failing because ddsi_typeid_compare_assignability_check is not in symbol_export.c

Some vendors provide broken type information or type lookup replies, or
they do it properly but run into Cyclone's limited type lookup
implementation. This commit adds an option to completely ignore the
"type information" parameter in discovery from specified vendors. If you
know that matching on type name is equivalent to performing the
assignability check in the system, this can save the day.

The direct reason is I could not find a decent workaround for various
problems with the Fast-DDS version used by ROS2 late 2025 (commit
33bb952a0e80e2b158571cb2d64ed6b2003609db on the 3.2.x branch), which set
TRY_CONSTRUCT incorrectly on collection elements and responded to type
lookup requests for a minimal type with a complete type but without the
required complete-to-minimal identifier mapping and so any attempt at
converting from a complete type object to a minimal will fail.

The latter could be mitigated by switching to using complete type
objects for assignability checks if the response to a request for a
minimal type object was a complete type object and properly loading
dependent types. Those are valuable improvements, but bring their own
complications.

It also turns out that Fast-DDS didn't request the types from Cyclone,
and therefore can't be performing the assignability check to begin
with. All-in-all adding a setting to ignore the TYPE_INFORMATION is a
pragmatic choice to get things working.

Signed-off-by: Erik Boasson <eb@ilities.com>
@eboasson eboasson force-pushed the reject-invalid-try-construct-ignore-type-information branch from b87357c to 319dadb Compare January 7, 2026 10:48
@eboasson eboasson merged commit ea9f8f7 into eclipse-cyclonedds:master Jan 7, 2026
22 checks passed
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