feat: extract shared cmake modules into ros2_medkit_cmake package#295
Merged
feat: extract shared cmake modules into ros2_medkit_cmake package#295
Conversation
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.
27a785c to
125729f
Compare
This was referenced Mar 19, 2026
Contributor
There was a problem hiding this comment.
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_cmakepackage to install and expose shared CMake modules via*-extras.cmake. - Migrate multiple packages from relative
CMAKE_MODULE_PATHmanipulation tofind_package(ros2_medkit_cmake REQUIRED)and add correspondingbuildtool_depends. - Extract/introduce
ros2_medkit_graph_provideras an external plugin package and extendPluginContext/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.pyimportsament_index_python(get_package_share_directory / get_package_prefix), butpackage.xmldoes not declare anexec_dependonament_index_python. This can cause runtime failures in Debian/isolated installs where the dependency isn’t pulled in indirectly. Please addament_index_pythonas anexec_depend(ordepend) 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
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
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
Move
ROS2MedkitCompat,ROS2MedkitCcache, andROS2MedkitLintingcmake modules from the top-levelcmake/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 relativeCMAKE_MODULE_PATHpaths.The new package uses ament's
*-extras.cmakehook to auto-addCMAKE_MODULE_PATHafterfind_package(ros2_medkit_cmake). All 11 consuming packages are migrated from relative path includes tofind_package()+<buildtool_depend>.Issue
Type
Testing
ros2_medkit_cmakeresolves first (0.77s).clang-tidycorrectly placed inshare/ros2_medkit_cmake/cmake/CMAKE_MODULE_PATHreferences remain in anyCMakeLists.txtChecklist