-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds includes for action wrapper IDL messages fields. #337
Conversation
self.includes = [ | ||
Include('builtin_interfaces/msg/Time.idl') | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Includes are not specific to an Action
but are available through the IdlContent
instance. Therefore I don't think this should be added to the Action
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is the Action
that's adding the field, I thought it was cleaner to keep it as an implementation detail.
@@ -235,6 +235,7 @@ def extract_content_from_ast(tree): | |||
name=goal_request_basename), | |||
goal_request, result_response, feedback_message) | |||
content.elements.append(action) | |||
content.elements.extend(action.includes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could add an explicit Include
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's the other option, assuming we keep both parser and Action
specific fields in sync.
@@ -234,6 +234,7 @@ def extract_content_from_ast(tree): | |||
namespaces=goal_request.structure.type.namespaces, | |||
name=goal_request_basename), | |||
goal_request, result_response, feedback_message) | |||
content.elements += action.implicit_includes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might result in a duplicate include though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a countermeasure for this in ros2/rosidl_dds#75dadd486c089842072b2f61cf5c555ea2f3eec3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add the deduplication here (rather than in potentially every location which uses this API)?
|
||
all_includes = content.get_elements_of_type(Include) | ||
unique_include_locators = set([ | ||
include.locator for include in all_includes]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect the linter to warn about this. This likely needs to be a set comprehension instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hidmic Once you have checked this (and updated if necessary) please squash merge this PR into idl-stage-7
.
Running CI with this branch seems to resolve the current build error, moving onto another:
|
I am going ahead and merge this in order to be able to build and test from a single branch. |
@@ -234,7 +234,13 @@ def extract_content_from_ast(tree): | |||
namespaces=goal_request.structure.type.namespaces, | |||
name=goal_request_basename), | |||
goal_request, result_response, feedback_message) | |||
content.elements.append(action) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch remove the appending of the action.
* Adds includes for action wrapper IDL messages fields. * move includes * add includes before action * Deduplicates implicit action includes.
* Adds includes for action wrapper IDL messages fields. * move includes * add includes before action * Deduplicates implicit action includes.
…ction types (#334) * add Python function for IDL-based generators * update C and C++ message generators to use IDL-based extension point * update includes in typesupport packages * replace separate action generation with IDL-based approach * don't pass .action files to legacy message generators * temporary use custom map in not yet updated generator * strip action specific suffixes from include filename * add action templates to list of dependencies * match constants with message * traits * native path * escape JSON correctly * rsplit * fix warning * comment fix * unique include directives * make pydot optional * fix linter * linter * fix comment * remove service check for feedback suffix * use UINT8_MAX * fix comment * extend action struct with FeedbackMessage * update C and C++ introspection typesupport generators to use IDL-based extension point * add missing symbols * address linter warnings * instantiate parser on demand * Add option to generate_files() for keeping idl filename case (#336) * remove unused var * remove comment * fix missing import introduced during rebase * change exported variable from <pkg>_INTERFACE_FILES to <pkg>_IDL_FILES and only include .idl files * keep <pkg>_INTERFACE_FILES for legacy generators * fix upper string length for nested strings * fix default value for strings with upper bounds * fix classification of unbounded sequence of bounded strings * fix previous fix * Adds includes for action wrapper IDL messages fields. (#337) * Adds includes for action wrapper IDL messages fields. * move includes * add includes before action * Deduplicates implicit action includes. * Use set comprehension instead (nit fix) * fix adding actions * Add missing closing brace for 'extern C' * fix missing service request/response symbols * don't generate png of AST by default * expose function to get AST * no enum support yet * fix more missing symbols * fixup * fix includes * undef NO_ERROR for Windows This was causing a build issue in tf2_msgs where a constant with the same name is defined. * dump working copy * fix struct identifier extraction when having an annotation * match renamed action types * update grammar to improve parse performance * remove obsolete ImplicitFieldCollision logic * update action tests * fix value range of char in adapter * fix char being unsigned * disable debug images of AST * use unique_identifier_msgs for goal id * up doc * fix regression on Windows * remove obsolete comment * try to fix Windows warning * remove obsolete constant * targeting Dashing * removed comment * moved template calls * remove obsolete todo * removed commented code * fix initialization of u16string * fix u16string len * avoid double initialization * moved template calls * comment in test * fix has_bounded_size trait * readd explicit dependency on absolute paths of idl files * reduce logic with all action related types being in a single file
Small pull request, fixing missing includes for action wrapping messages.