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

Open
wants to merge 13 commits into
base: rolling
Choose a base branch
from
Open

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.

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde self-assigned this Aug 28, 2024
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@@ -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!

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde ahcorde marked this pull request as ready for review September 4, 2024 13:09
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
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.

2 participants