Fix Rolling CI: migrate ament_target_dependencies to compat shim#242
Merged
Fix Rolling CI: migrate ament_target_dependencies to compat shim#242
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses Rolling CI build failures by introducing a cross-distro CMake compatibility shim and migrating package CMakeLists to use it, so dependency linkage works whether ament_target_dependencies() exists or not.
Changes:
- Added
medkit_target_dependencies()tocmake/ROS2MedkitCompat.cmakeas a Rolling-safe replacement forament_target_dependencies(). - Migrated dependency declarations in 6 packages’
CMakeLists.txtto usemedkit_target_dependencies(). - Ensured packages that didn’t previously include
ROS2MedkitCompatnow do so before using the new macro.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmake/ROS2MedkitCompat.cmake | Adds medkit_target_dependencies() compat macro with Rolling fallback behavior. |
| src/ros2_medkit_gateway/CMakeLists.txt | Switches target dependency declarations to medkit_target_dependencies(). |
| src/ros2_medkit_serialization/CMakeLists.txt | Switches library + test dependency declarations to medkit_target_dependencies(). |
| src/ros2_medkit_fault_manager/CMakeLists.txt | Switches library + test dependency declarations to medkit_target_dependencies(). |
| src/ros2_medkit_fault_reporter/CMakeLists.txt | Adds compat include and switches dependencies to medkit_target_dependencies(). |
| src/ros2_medkit_diagnostic_bridge/CMakeLists.txt | Adds compat include and switches dependencies to medkit_target_dependencies(). |
| src/ros2_medkit_integration_tests/CMakeLists.txt | Adds compat include and switches demo nodes to medkit_target_dependencies(). |
Buffer deps per-visibility to avoid mixing target_link_libraries signatures. Add fallback to dep::dep imported targets and FATAL_ERROR when a dependency cannot be resolved.
… specified On Rolling, ament_add_gtest_executable uses the plain signature for target_link_libraries. Our medkit_target_dependencies macro was unconditionally using the keyword signature (PUBLIC), causing CMake to error with "all uses must be either all-keyword or all-plain". Now the macro uses the plain signature when no visibility keyword is passed, and only uses keyword form when explicitly requested (e.g. medkit_target_dependencies(target PUBLIC dep1 dep2)).
mfaferek93
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Added
medkit_target_dependencies()compat shim tocmake/ROS2MedkitCompat.cmakeand migrated all 30ament_target_dependenciescalls across 6 packages to use it. The macro delegates toament_target_dependencieson Humble/Jazzy and falls back totarget_link_librarieswith${pkg_TARGETS}on Rolling where the original macro was removed from ament_cmake.Issue
Type
Testing
Checklist