Skip to content

feat: extract shared cmake modules into ros2_medkit_cmake package#295

Merged
bburda merged 2 commits intomainfrom
feature/ros2-medkit-cmake-package
Mar 19, 2026
Merged

feat: extract shared cmake modules into ros2_medkit_cmake package#295
bburda merged 2 commits intomainfrom
feature/ros2-medkit-cmake-package

Conversation

@bburda
Copy link
Collaborator

@bburda bburda commented Mar 19, 2026

Pull Request

Summary

Move ROS2MedkitCompat, ROS2MedkitCcache, and ROS2MedkitLinting cmake modules from the top-level cmake/ directory into a proper ament package (ros2_medkit_cmake). This fixes the Jenkins ROS buildfarm failure where isolated Debian package builds could not find the shared modules via relative CMAKE_MODULE_PATH paths.

The new package uses ament's *-extras.cmake hook to auto-add CMAKE_MODULE_PATH after find_package(ros2_medkit_cmake). All 11 consuming packages are migrated from relative path includes to find_package() + <buildtool_depend>.


Issue


Type

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

Testing

  • Clean build from scratch: all 13 packages build successfully, ros2_medkit_cmake resolves first (0.77s)
  • Full unit test suite: 1692 tests passed, 0 failures
  • Verified installed layout: cmake modules + .clang-tidy correctly placed in share/ros2_medkit_cmake/cmake/
  • Verified no stale CMAKE_MODULE_PATH references remain in any CMakeLists.txt

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 March 19, 2026 17:16
bburda added a commit to selfpatch/selfpatch_demos that referenced this pull request Mar 19, 2026
The shared cmake modules are now a proper ament package
(ros2_medkit_cmake) instead of a loose cmake/ directory.
Replace `cp -r ros2_medkit/cmake` with `mv ros2_medkit/src/ros2_medkit_cmake .`
in all Dockerfiles.

See: selfpatch/ros2_medkit#295
Move ROS2MedkitCompat, ROS2MedkitCcache, and ROS2MedkitLinting cmake
modules from the top-level cmake/ directory into a proper ament package.
This allows each package to be built in isolation (e.g. on the ROS
buildfarm) without relying on relative paths to a parent workspace.

All consuming packages now use find_package(ros2_medkit_cmake REQUIRED)
instead of list(APPEND CMAKE_MODULE_PATH ...) with relative paths.
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 ROS buildfarm/isolated build failures by moving shared CMake modules into a dedicated ros2_medkit_cmake ament package and migrating consuming packages to use find_package(ros2_medkit_cmake). It also updates the plugin system to support a new external graph-provider plugin package (with added PluginContext capabilities and tests/docs).

Changes:

  • Introduce ros2_medkit_cmake package to install and expose shared CMake modules via *-extras.cmake.
  • Migrate multiple packages from relative CMAKE_MODULE_PATH manipulation to find_package(ros2_medkit_cmake REQUIRED) and add corresponding buildtool_depends.
  • Extract/introduce ros2_medkit_graph_provider as an external plugin package and extend PluginContext/gateway plumbing to support entity snapshots, fault listing, and cyclic sampler registration.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/ros2_medkit_serialization/package.xml Add ros2_medkit_cmake as a buildtool dependency.
src/ros2_medkit_serialization/CMakeLists.txt Switch to find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_plugins/ros2_medkit_graph_provider/test/test_graph_provider_plugin.cpp Update/extend graph provider unit tests and add context stubs.
src/ros2_medkit_plugins/ros2_medkit_graph_provider/src/graph_provider_plugin_exports.cpp Add plugin export entrypoints for dynamic loading.
src/ros2_medkit_plugins/ros2_medkit_graph_provider/src/graph_provider_plugin.cpp Update plugin to use new PluginContext APIs and config model.
src/ros2_medkit_plugins/ros2_medkit_graph_provider/package.xml New plugin package manifest.
src/ros2_medkit_plugins/ros2_medkit_graph_provider/include/ros2_medkit_graph_provider/graph_provider_plugin.hpp Plugin public header adjustments (context/config changes).
src/ros2_medkit_plugins/ros2_medkit_graph_provider/CMakeLists.txt Build/install plugin module and add plugin-specific tests.
src/ros2_medkit_integration_tests/test/features/test_graph_provider_plugin.test.py New integration tests validating dynamic plugin loading and endpoint behavior.
src/ros2_medkit_integration_tests/package.xml Add ros2_medkit_cmake buildtool dep and graph provider as test dependency.
src/ros2_medkit_integration_tests/CMakeLists.txt Use find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_gateway/test/test_gateway_node.cpp Remove expectations tied to built-in graph provider behavior.
src/ros2_medkit_gateway/src/plugins/plugin_context.cpp Implement new PluginContext APIs (snapshot/faults/sampler registration).
src/ros2_medkit_gateway/src/gateway_node.cpp Stop loading graph provider as built-in; pass sampler registry to plugin context; improve plugin path parameter descriptor.
src/ros2_medkit_gateway/package.xml Add ros2_medkit_cmake buildtool dep; adjust dependencies.
src/ros2_medkit_gateway/launch/gateway.launch.py Optionally auto-load graph provider plugin if installed (resolve .so path).
src/ros2_medkit_gateway/include/ros2_medkit_gateway/plugins/plugin_types.hpp Bump PLUGIN_API_VERSION (ABI/vtable change).
src/ros2_medkit_gateway/include/ros2_medkit_gateway/plugins/plugin_context.hpp Extend PluginContext interface with snapshot/faults/sampler APIs.
src/ros2_medkit_gateway/config/gateway_params.yaml Add graph provider plugin params and clarify default plugin list.
src/ros2_medkit_gateway/CMakeLists.txt Switch to find_package(ros2_medkit_cmake); remove built-in graph provider compilation/tests.
src/ros2_medkit_fault_reporter/package.xml Add ros2_medkit_cmake buildtool dependency.
src/ros2_medkit_fault_reporter/CMakeLists.txt Use find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_fault_manager/package.xml Add ros2_medkit_cmake buildtool dependency.
src/ros2_medkit_fault_manager/CMakeLists.txt Use find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_discovery_plugins/ros2_medkit_topic_beacon/package.xml Add ros2_medkit_cmake buildtool dependency.
src/ros2_medkit_discovery_plugins/ros2_medkit_topic_beacon/CMakeLists.txt Use find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_discovery_plugins/ros2_medkit_param_beacon/package.xml Add ros2_medkit_cmake buildtool dependency.
src/ros2_medkit_discovery_plugins/ros2_medkit_param_beacon/CMakeLists.txt Use find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_discovery_plugins/ros2_medkit_linux_introspection/package.xml Add ros2_medkit_cmake buildtool dependency.
src/ros2_medkit_discovery_plugins/ros2_medkit_linux_introspection/CMakeLists.txt Use find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_discovery_plugins/ros2_medkit_beacon_common/package.xml Add ros2_medkit_cmake buildtool dependency.
src/ros2_medkit_discovery_plugins/ros2_medkit_beacon_common/CMakeLists.txt Use find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_diagnostic_bridge/package.xml Add ros2_medkit_cmake buildtool dependency.
src/ros2_medkit_diagnostic_bridge/CMakeLists.txt Use find_package(ros2_medkit_cmake) for shared modules.
src/ros2_medkit_cmake/package.xml New ament package manifest for shared CMake modules.
src/ros2_medkit_cmake/cmake/ros2_medkit_cmake-extras.cmake Auto-extend CMAKE_MODULE_PATH after find_package.
src/ros2_medkit_cmake/cmake/ROS2MedkitLinting.cmake Update .clang-tidy lookup path for installed layout.
src/ros2_medkit_cmake/cmake/ROS2MedkitCompat.cmake Update usage docs to the new find_package(ros2_medkit_cmake) pattern.
src/ros2_medkit_cmake/cmake/ROS2MedkitCcache.cmake New shared ccache auto-detection module.
src/ros2_medkit_cmake/CMakeLists.txt New package build/install rules for shared modules and .clang-tidy.
docs/tutorials/plugin-system.rst Document new PluginContext APIs and graph provider plugin usage; update API version.
Comments suppressed due to low confidence (1)

src/ros2_medkit_gateway/package.xml:17

  • gateway.launch.py imports ament_index_python (get_package_share_directory / get_package_prefix), but package.xml does not declare an exec_depend on ament_index_python. This can cause runtime failures in Debian/isolated installs where the dependency isn’t pulled in indirectly. Please add ament_index_python as an exec_depend (or depend) here.
  <buildtool_depend>ament_cmake</buildtool_depend>
  <buildtool_depend>ros2_medkit_cmake</buildtool_depend>

  <depend>rclcpp</depend>
  <depend>diagnostic_msgs</depend>
  <depend>std_msgs</depend>
  <depend>std_srvs</depend>

Add Apache 2.0 copyright header to CMakeLists.txt. Install .clang-tidy
conditionally - the file exists in a colcon workspace (../../.clang-tidy)
but not on the buildfarm where the package is built from an isolated
tarball. This is safe because the buildfarm uses BUILD_TESTING=OFF
so linting is never invoked.
@bburda bburda self-assigned this Mar 19, 2026
@bburda bburda requested a review from mfaferek93 March 19, 2026 17:38
Copy link
Collaborator

@mfaferek93 mfaferek93 left a comment

Choose a reason for hiding this comment

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

lgtm!

@bburda bburda merged commit f776587 into main Mar 19, 2026
17 of 18 checks passed
@bburda bburda deleted the feature/ros2-medkit-cmake-package branch March 19, 2026 18:33
bburda added a commit to selfpatch/selfpatch_demos that referenced this pull request Mar 19, 2026
The shared cmake modules are now a proper ament package
(ros2_medkit_cmake) instead of a loose cmake/ directory.
Replace `cp -r ros2_medkit/cmake` with `mv ros2_medkit/src/ros2_medkit_cmake .`
in all Dockerfiles.

See: selfpatch/ros2_medkit#295
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract shared cmake modules into ros2_medkit_cmake ament package

3 participants