ament: install .srv and .action definitions alongside .msg files#627
Open
xiangguomin wants to merge 1 commit into
Open
ament: install .srv and .action definitions alongside .msg files#627xiangguomin wants to merge 1 commit into
xiangguomin wants to merge 1 commit into
Conversation
Previously the IDL source loop guarded with `if src.extension != "msg": continue`, so .srv and .action files were silently dropped from the ament share tree. Any runtime type-introspection tool (foxglove_bridge, `ros2 service call`, `ros2 interface show`) that looks for the definitions at share/<pkg>/srv/ or share/<pkg>/action/ would not find them and fall back to IDL, producing "Could not find definition for type" warnings. Route each source into its matching subdirectory (msg/, srv/, action/) under share/<pkg>/ instead of hardcoding msg/ for all types. Fixes mvukov#626
mvukov
approved these changes
May 17, 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.
Summary
Fixes #626.
The IDL source loop in
_create_ament_setup(ament.bzl) had an early-exit guard that silently dropped.srvand.actionfiles from the ament share tree:Any runtime type-introspection tool (foxglove_bridge,
ros2 service call,ros2 interface show) that looks for definitions atshare/<pkg>/srv/orshare/<pkg>/action/would not find them and fall back to IDL, producing warnings like:Fix
Route each source into its matching subdirectory (
msg/,srv/,action/) undershare/<pkg>/instead of hardcodingmsg/for all types:Test
Verified by building a
ros2_cpp_binarywithidl_deps = ["@ros2_rcl_interfaces//:rcl_interfaces"]and confirming thatshare/rcl_interfaces/srv/DescribeParameters.srv(and all other.srvfiles) are present in the ament_setup output tree. The foxglove_bridge "Could not find definition" warnings are gone after this change.