Skip to content
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

Added windows support #273

Closed
wants to merge 5 commits into from
Closed

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Aug 28, 2024

Require this PR ros2/rcutils#473 in rcutils

The code just compile, I didn't try the code yet.

@ahcorde ahcorde self-assigned this Aug 28, 2024
@ahcorde ahcorde mentioned this pull request Aug 28, 2024
@@ -25,7 +25,7 @@ set(ZENOHC_CARGO_FLAGS "--no-default-features$<SEMICOLON>--features=zenoh/shared
# - https://github.com/eclipse-zenoh/zenoh/pull/1150 (fix deadlock issue https://github.com/ros2/rmw_zenoh/issues/182)
ament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION 548ee8dde0f53a58c06e68a2949949b31140c36c
VCS_VERSION 134dbfa06ca212def5fb51dd8e816734dfd8dff6
Copy link
Member

Choose a reason for hiding this comment

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

With #269 merged, the commit version is the latest zenoh-c so we don't have to change the commit here to an older one.

@@ -63,7 +64,7 @@ int main(int argc, char ** argv)
// If not already defined, set the logging environment variable for Zenoh router
// to info level by default.
// TODO(Yadunund): Switch to rcutils_get_env once it supports not overwriting values.
if (setenv(ZENOH_LOG_ENV_VAR_STR, ZENOH_LOG_INFO_LEVEL_STR, 0) != 0) {
if (rcutils_set_env_overwrite(ZENOH_LOG_ENV_VAR_STR, ZENOH_LOG_INFO_LEVEL_STR, 0) != 0) {
Copy link
Member

Choose a reason for hiding this comment

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

It might be better to leave the switch to rcutils_set_env_overwrite/rcutils_set_env2 once the upstream PR is reviewed and merged. Given that it may not be backported to iron/jazzy, it might be best if we use a combination of rcutils_get_env check first followed by rcutils_set_env to get the same behavior as rcutils_set_env_overwrite.

@@ -43,7 +43,12 @@ rmw_ret_t zenoh_router_check(z_session_t session)
};

rmw_ret_t ret = RMW_RET_OK;
z_owned_closure_zid_t router_callback = z_closure(callback, nullptr /* drop */, &context);
// z_owned_closure_zid_t router_callback = z_closure(callback, nullptr /* drop */, &context);
z_owned_closure_zid_t router_callback;
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

z_closure is a define which I believe use syntax that it's not compatible with the windows compiler

Copy link
Member

Choose a reason for hiding this comment

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

I see. It would be good to document this. Also let's add a function make_z_closure() to the anonymous namesapce that constructs and returns the z_owned_closure_zid_t. That way we implement it once somewhere and we simply update the z_closure() calls everywhere to make_z_closure().

Copy link
Member

Choose a reason for hiding this comment

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

@ahcorde I think you may have missed this suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are different z_owned_closure_*_t, I can create a template function. Where is the right file to include this new function ?

Copy link
Member

Choose a reason for hiding this comment

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

That would be great! I'd put the function in detail/rmw_data_types.hpp right above where the sub_data_handler is defined!

@ahcorde ahcorde marked this pull request as ready for review September 4, 2024 13:09
@ahcorde ahcorde requested a review from Yadunund September 4, 2024 13:09
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
@ahcorde ahcorde force-pushed the ahcorde/rolling/windows_support branch from 5430050 to 060deae Compare December 4, 2024 12:39
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 4, 2024

Good and bad news,

On Linux this changes are not generating any new failures, but on windows I can see the following:

  • test_services__rmw_zenoh_cpp
109: [INFO] [1733350350.285711600] [rmw_zenoh_cpp]: Successfully connected to a Zenoh router with id 3ddd7220984aa1c259d172d9cfef983.
109: C:\ros2_ws\src\ros2\rcl\rcl\test\rcl\test_service.cpp(296): error: Expected equality of these values:
109:   0
109:   ret
109:     Which is: 1
109: Failed to get source_timestamp from client call attachment, at C:\ros2_ws\src\rmw_zenoh\rmw_zenoh_cpp\src\detail\rmw_service_data.cpp:341, at C:\ros2_ws\src\ros2\rcl\rcl\src\rcl\service.c:344
  • test_subcription__rmw_zenoh_cpp
110: C:\ros2_ws\src\ros2\rcl\rcl\test\rcl\test_subscription.cpp(318): error: Expected: (0u) != (message_info.source_timestamp), actual: 0 vs 0
110:
110: C:\ros2_ws\src\ros2\rcl\rcl\test\rcl\test_subscription.cpp(319): error: Value of: pre_publish_time <= message_info.source_timestamp
110:   Actual: false
110: Expected: true
110: 1733350355261743100 > 0
  • test_service_event_publisher__rmw_zenoh_cpp
117: [ERROR] [1733350404.986322700] [rmw_zenoh_cpp]: Unable to obtain source timestamp from the attachment.
117: C:\ros2_ws\src\ros2\rcl\rcl\test\rcl\test_service_event_publisher.cpp(650): error: Expected equality of these values:
117:   0
117:   ret
117:     Which is: 1
117: Failed to get source_timestamp from client call attachment, at C:\ros2_ws\src\rmw_zenoh\rmw_zenoh_cpp\src\detail\rmw_service_data.cpp:341, at C:\ros2_ws\src\ros2\rcl\rcl\src\rcl\service.c:344
  • test_gt_type_description_service__rmw_zenoh_cpp
120: C:\ros2_ws\src\ros2\rcl\rcl\test\rcl\test_get_type_description_service.cpp(283): error: Expected equality of these values:
120:   0
120:   ret
120:     Which is: 1
120: Failed to get source_timestamp from client call attachment, at C:\ros2_ws\src\rmw_zenoh\rmw_zenoh_cpp\src\detail\rmw_service_data.cpp:341, at C:\ros2_ws\src\ros2\rcl\rcl\src\rcl\service.c:344
  • test_services__rmw_zenoh_cpp (Timeout)

Signed-off-by: Alejandro Hernandez Cordero <[email protected]>

Verified

This commit was signed with the committer’s verified signature.
ahcorde Alejandro Hernández Cordero
…ndows_support
@ahcorde ahcorde changed the base branch from rolling to rolling-0.11 December 9, 2024 10:46
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 9, 2024

Just in case, change base to rolling-0.11

@clalancette
Copy link
Collaborator

Closing this one, as we merged support for Windows into rolling in #312.

@clalancette clalancette deleted the ahcorde/rolling/windows_support branch December 11, 2024 18:47
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.

None yet

3 participants