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

Workaround ros2/rosidl_typesupport#120 #284

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions bazel_ros2_rules/ros2/rosidl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,18 @@ def rosidl_interfaces_group(

Additional keyword arguments are those common to all rules.
"""

# Workaround ros2/rosidl_typesupport#120
# The introspection type supports assume the library name is the same as
# the package name (aka "group" here). If the ROS workspace supports
# multiple typesupports then the introspection type support will fail
# to load.
# Workaround by making the library name the same as the group name, and
# make aliases for those targets.
real_name = name
if group != None:
name = group

rosidl_definitions_filegroup(
name = _make_public_name(name, "_defs"),
group = group or name,
Expand Down Expand Up @@ -1344,3 +1356,20 @@ def rosidl_interfaces_group(
py_library_rule = py_library_rule,
**kwargs
)

if real_name != name:
native.alias(
name = real_name + "_defs",
actual = name + "_defs",
**kwargs
)
native.alias(
name = real_name + "_cc",
actual = name + "_cc",
**kwargs
)
native.alias(
name = real_name + "_py",
actual = name + "_py",
**kwargs
)