You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
embeddedRTPS failed to build in CI. This is because ament_cmake recently removed ament_cmake_target_dependencies. However, micro-ROS/embeddedRTPS, micro-ROS/rmw_embeddedrtps, and micro-ROS/rcl are still using it. The call in micro-ROS/rcl is wrapped with if(NOT RCL_MICROROS), so it doesn't trigger during the build.
An AI provided me with a very hacky (but working) workaround — adding ament_target_dependencies.cmake back into ament_cmake during the build... But I think it's better to update the three libraries mentioned above.
diff --git a/libmicroros.mk b/libmicroros.mk
index 02adea3..11b30f5 100644
--- a/libmicroros.mk
+++ b/libmicroros.mk
@@ -40,6 +40,9 @@ $(EXTENSIONS_DIR)/micro_ros_dev/install:
git clone -b rolling https://github.com/ament/ament_index src/ament_index; \
touch src/ament_cmake_ros/rmw_test_fixture_implementation/COLCON_IGNORE; \
touch src/ament_cmake_ros/rmw_test_fixture/COLCON_IGNORE; \
+ cp $(EXTENSIONS_DIR)/patches/ament_target_dependencies.cmake src/ament_cmake/ament_cmake_target_dependencies/cmake/; \
+ printf '\ninclude(\n "$${ament_cmake_target_dependencies_DIR}/ament_target_dependencies.cmake")\n' \
+ >> src/ament_cmake/ament_cmake_target_dependencies/ament_cmake_target_dependencies-extras.cmake; \
colcon build --cmake-args -DBUILD_TESTING=OFF -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=gcc;
$(EXTENSIONS_DIR)/micro_ros_src/src:
diff --git a/patches/ament_target_dependencies.cmake b/patches/ament_target_dependencies.cmake
new file mode 100644
index 0000000..6d7f22f
--- /dev/null
+++ b/patches/ament_target_dependencies.cmake
@@ -0,0 +1,147 @@
+# Copyright 2014-2020 Open Source Robotics Foundation, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Compatibility shim: restores the historical ament_target_dependencies()
+# function that was removed from rolling ament_cmake on 2026-01-13
+# (commit 88c3e61, PR ament/ament_cmake#614). Several upstream micro-ROS
+# packages (notably embeddedRTPS and rmw_embeddedrtps) still rely on this
+# macro to propagate include directories declared via the classic
+# ${pkg}_INCLUDE_DIRS variables (their IMPORTED targets do not set
+# INTERFACE_INCLUDE_DIRECTORIES).
+#
+# The implementation below is the verbatim copy of the upstream file
+# ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake
+# at commit b9a046b^ (just before the deprecation/removal series), with
+# only this header replaced.
+
+function(ament_target_dependencies target)
+ if(NOT TARGET ${target})
+ message(FATAL_ERROR "ament_target_dependencies() the first argument must be a valid target name")
+ endif()
+ if(${ARGC} GREATER 0)
+ cmake_parse_arguments(ARG "INTERFACE;PUBLIC;SYSTEM" "" "" ${ARGN})
+ set(ARGVIND 1)
+ set(system_keyword "")
+ set(optional_keyword "")
+ set(required_keyword "PUBLIC")
+ if(ARG_SYSTEM)
+ if(NOT "${ARGV${ARGVIND}}" STREQUAL "SYSTEM")
+ message(FATAL_ERROR "ament_target_dependencies() SYSTEM keyword is only allowed before the package names and other keywords")
+ endif()
+ set(system_keyword SYSTEM)
+ math(EXPR ARGVIND "${ARGVIND} + 1")
+ endif()
+ if(ARG_INTERFACE)
+ if(NOT "${ARGV${ARGVIND}}" STREQUAL "INTERFACE")
+ message(FATAL_ERROR "ament_target_dependencies() INTERFACE keyword is only allowed before the package names")
+ endif()
+ set(optional_keyword INTERFACE)
+ set(required_keyword INTERFACE)
+ endif()
+ if(ARG_PUBLIC)
+ if(NOT "${ARGV${ARGVIND}}" STREQUAL "PUBLIC")
+ message(FATAL_ERROR "ament_target_dependencies() PUBLIC keyword is only allowed before the package names")
+ endif()
+ set(optional_keyword PUBLIC)
+ endif()
+ set(definitions "")
+ set(include_dirs "")
+ set(interfaces "")
+ set(libraries "")
+ set(link_flags "")
+ foreach(package_name ${ARG_UNPARSED_ARGUMENTS})
+ if(NOT "${${package_name}_FOUND}")
+ message(FATAL_ERROR "ament_target_dependencies() the passed package name '${package_name}' was not found before")
+ endif()
+ # if a package provides modern CMake interface targets use them
+ # exclusively assuming the classic CMake variables only exist for
+ # backward compatibility
+ set(use_modern_cmake FALSE)
+ if(NOT "${${package_name}_TARGETS}" STREQUAL "")
+ foreach(_target ${${package_name}_TARGETS})
+ # only use actual targets
+ # in case a package uses this variable for other content
+ if(TARGET "${_target}")
+ list_append_unique(interfaces ${_target})
+ set(use_modern_cmake TRUE)
+ endif()
+ endforeach()
+ endif()
+ if(NOT use_modern_cmake AND NOT "${${package_name}_INTERFACES}" STREQUAL "")
+ foreach(_interface ${${package_name}_INTERFACES})
+ # only use actual targets
+ # in case a package uses this variable for other content
+ if(TARGET "${_interface}")
+ list_append_unique(interfaces ${_interface})
+ set(use_modern_cmake TRUE)
+ endif()
+ endforeach()
+ if(use_modern_cmake)
+ message(DEPRECATION
+ "Package ${package_name} is exporting the variable "
+ "${package_name}_INTERFACES which is deprecated, it should export
+ ${package_name}_TARGETS instead")
+ endif()
+ endif()
+ if(NOT use_modern_cmake)
+ # otherwise use the classic CMake variables
+ list_append_unique(definitions ${${package_name}_DEFINITIONS})
+ list_append_unique(include_dirs ${${package_name}_INCLUDE_DIRS})
+ foreach(library ${${package_name}_LIBRARIES})
+ if(NOT "${${package_name}_LIBRARY_DIRS}" STREQUAL "")
+ if(NOT IS_ABSOLUTE ${library} OR NOT EXISTS ${library})
+ unset(lib CACHE)
+ find_library(lib NAMES ${library} PATHS ${${package_name}_LIBRARY_DIRS} NO_DEFAULT_PATH)
+ if(lib)
+ set(library ${lib})
+ endif()
+ endif()
+ endif()
+ list(APPEND libraries ${library})
+ endforeach()
+ list_append_unique(link_flags ${${package_name}_LINK_FLAGS})
+ endif()
+ endforeach()
+ if(NOT ARG_INTERFACE)
+ target_compile_definitions(${target}
+ ${required_keyword} ${definitions})
+ # the interface include dirs must be ordered
+ set(interface_include_dirs)
+ foreach(interface ${interfaces})
+ get_target_property(_include_dirs ${interface} INTERFACE_INCLUDE_DIRECTORIES)
+ if(_include_dirs)
+ list_append_unique(interface_include_dirs ${_include_dirs})
+ endif()
+ endforeach()
+ ament_include_directories_order(ordered_interface_include_dirs ${interface_include_dirs})
+ # the interface include dirs are used privately to ensure proper order
+ # and the interfaces cover the public case
+ target_include_directories(${target} ${system_keyword}
+ PRIVATE ${ordered_interface_include_dirs})
+ endif()
+ ament_include_directories_order(ordered_include_dirs ${include_dirs})
+ target_link_libraries(${target}
+ ${optional_keyword} ${interfaces})
+ target_include_directories(${target} ${system_keyword}
+ ${required_keyword} ${ordered_include_dirs})
+ if(NOT ARG_INTERFACE)
+ ament_libraries_deduplicate(unique_libraries ${libraries})
+ target_link_libraries(${target}
+ ${optional_keyword} ${unique_libraries})
+ foreach(link_flag IN LISTS link_flags)
+ set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${link_flag} ")
+ endforeach()
+ endif()
+ endif()
+endfunction()
I am planning to update micro-ROS/rcl soon or upstream its patches.
Regarding embeddedRTPS: Since the micro-ROS fork is now archived, I think the best way to go about this would be to either upstream the needed patches in our fork and fix the project to work with the latest ROS or completely drop support for embeddedRTPS.
For now, I think it would be best to disable it in CI and mark it as broken in the README after #325 is merged.
Activity
Narukara commentedon Apr 30, 2026
The hacky workaround:
Click to expand
Amronos commentedon Apr 30, 2026
I am planning to update
micro-ROS/rclsoon or upstream its patches.Regarding
embeddedRTPS: Since the micro-ROS fork is now archived, I think the best way to go about this would be to either upstream the needed patches in our fork and fix the project to work with the latest ROS or completely drop support forembeddedRTPS.For now, I think it would be best to disable it in CI and mark it as broken in the README after #325 is merged.
Narukara commentedon May 6, 2026
I agree to mark it as broken for now. Resolving this issue could take a fair amount of time.