Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Workaround ros2/rosidl_typesupport#120

* XXX Test that rosidl_generate_interfaces() works with group

* Revert "XXX Test that rosidl_generate_interfaces() works with group"

This reverts commit 182bd85.

* fixup - pass kwargs to alias targets
  • Loading branch information
sloretz authored Jun 20, 2023
1 parent cc773dd commit 425b017
Showing 1 changed file with 29 additions and 0 deletions.
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
)

0 comments on commit 425b017

Please sign in to comment.