Skip to content

Fix Rolling CI: migrate ament_target_dependencies to compat shim#242

Merged
bburda merged 4 commits intomainfrom
fix/rolling-ci-ament-migration
Feb 27, 2026
Merged

Fix Rolling CI: migrate ament_target_dependencies to compat shim#242
bburda merged 4 commits intomainfrom
fix/rolling-ci-ament-migration

Conversation

@bburda
Copy link
Collaborator

@bburda bburda commented Feb 27, 2026

Pull Request

Summary

Added medkit_target_dependencies() compat shim to cmake/ROS2MedkitCompat.cmake and migrated all 30 ament_target_dependencies calls across 6 packages to use it. The macro delegates to ament_target_dependencies on Humble/Jazzy and falls back to target_link_libraries with ${pkg_TARGETS} on Rolling where the original macro was removed from ament_cmake.


Issue


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

  • Local Jazzy build: all 7 packages build successfully
  • Local Jazzy tests: 1877 tests, 0 errors, 0 failures
  • CI should verify Humble, Jazzy, and Rolling (the fix) all pass

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

Copilot AI review requested due to automatic review settings February 27, 2026 10:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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() to cmake/ROS2MedkitCompat.cmake as a Rolling-safe replacement for ament_target_dependencies().
  • Migrated dependency declarations in 6 packages’ CMakeLists.txt to use medkit_target_dependencies().
  • Ensured packages that didn’t previously include ROS2MedkitCompat now 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().

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@bburda bburda requested a review from mfaferek93 February 27, 2026 10:54
@bburda bburda added the bug Something isn't working label Feb 27, 2026
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)).
@bburda bburda merged commit 329846a into main Feb 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Rolling CI: migrate from ament_target_dependencies to target_link_libraries

3 participants