-
Notifications
You must be signed in to change notification settings - Fork 125
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
[rosidl_generator_py] Fixes srv only generation #198
Conversation
@@ -121,7 +121,8 @@ def generate_py(generator_arguments_file, typesupport_impls): | |||
} | |||
data.update(functions) | |||
generated_file = os.path.join( | |||
args['output_dir'], 'msg', generated_filename % args['package_name']) | |||
args['output_dir'], generated_filename % args['package_name']) | |||
print('***generated file: %s' % generated_file) |
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.
You might want to remove this debug output.
list_append_unique(_generated_msg_c_files "${_output_path}/${_parent_folder}/_${PROJECT_NAME}_s.ep.${_typesupport_impl}.c") | ||
list_append_unique(_generated_msg_c_ts_${_typesupport_impl}_files "${_output_path}/${_parent_folder}/_${PROJECT_NAME}_s.ep.${_typesupport_impl}.c") | ||
list_append_unique(_generated_extension_files "${_output_path}/_${PROJECT_NAME}_s.ep.${_typesupport_impl}.c") | ||
list_append_unique(_generated_extension_${_typesupport_impl}_files "${_output_path}/_${PROJECT_NAME}_s.ep.${_typesupport_impl}.c") |
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.
Instead of repeating the whole value twice (and again twice for services) the variable _generated_extension_files
could be updated by appending _generated_extension_${_typesupport_impl}_files
at the end of each foreach
cycle.
You could even move this out of the loop iterating over the msg / srv files and only set it once if there are any msg or srv files. I think that would be even clearer since these variable only ever contain a single value per typesupport.
if(NOT _generated_msg_c_files STREQUAL "" OR NOT _generated_srv_c_files STREQUAL "") | ||
foreach(_typesupport_impl ${_typesupport_impls}) | ||
list_append_unique(_generated_extension_${_typesupport_impl}_files "${_output_path}/_${PROJECT_NAME}_s.ep.${_typesupport_impl}.c") | ||
list_append_unique(_generated_extension_files "${_generated_extension_${_typesupport_impl}_files}") |
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.
While using list_append_unique
works for both lines I would suggest using list(APPEND
instead since there are by design no duplicates ever.
c3bc782
to
3d8843b
Compare
ok I think this is ready for review now |
@@ -270,8 +269,8 @@ endforeach() | |||
if(BUILD_TESTING AND rosidl_generate_interfaces_ADD_LINTER_TESTS) | |||
if( | |||
NOT _generated_msg_py_files STREQUAL "" OR | |||
NOT _generated_msg_extension_files STREQUAL "" OR |
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.
Where is this variable coming from?
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.
bad search/replace apparently 😖
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.
Looks good to me. I assume you have tried it locally together with ros2/examples#163
Yes tried locally using the previously failing service examples |
fixes #193
Connects to #193
Reason of the failure: the generated file with all python extension symbols was not added to the library when no
.msg
files were presentWhat this PR does:
msg
subfolderCI:
Linux:
OSX:
Windows: