-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[master] visibility_control & portable installation. #1635
Conversation
@SteveMacenski Let me know logistically what branch I should target and anything I should know. This change is probably the one touching the most of the sources for Windows port, so I want to tackle this first. :) |
@seanyen you should retarget this to master, we don't accept PRs directly to distribution branches. It'll trickle into Foxy and cherry picked to eloquent. In terms of this PR, I'll admit I've never done software development in windows so I really don't understand much that's going on here other than "mhm, sure, looks like things I've seen before in other projects". What's this visibility control thing? How should I plan on dealing with this in the future? There seems to be a bunch of redundancy in the visibility control files for the packages. Can this be templated / generalized and added to the |
@@ -63,7 +63,7 @@ endif() | |||
install(TARGETS simple_goal_checker stopped_goal_checker standard_traj_generator | |||
ARCHIVE DESTINATION lib | |||
LIBRARY DESTINATION lib | |||
RUNTIME DESTINATION lib/${PROJECT_NAME} | |||
RUNTIME DESTINATION bin |
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.
libraries should go in bin?
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.
Yes, for a shared library (.DLL
files), in general it should go to the bin
folder for the install space (which is specified in RUNTIME DESTINATION
), and the corresponding imported library (.LIB
files) goes to lib
folder (which is specified in ARCHIVE DESTINATION
). On Windows, the symbols information is stored in the imported lib and the MSVC linker is linking against it instead of the shared lib.
REF: https://cmake.org/cmake/help/latest/command/install.html
Here is a comprehensive explanation for Linux developer :) From my perspective, the GCC and MSVC made a opposing default decision on how to decide what symbols to be visible of a shared library for the linker linkage. From the guide, for GCC, one can specify
There are many discussions (ament/ament_cmake#201 and ament/ament_cmake#164) on how we can do about it. Some methods might make it less manual, but the one adopted in the upstream ROS 2 packages is this approach. However I think it is still up to the package maintainer to decide what approach to use. |
b74fc09
to
8855b5a
Compare
@SteveMacenski Just want to quick check, I saw some test failures on and off from the CI for |
@seanyen, yes, those are just 2 flaky tests, #1585. I haven't had the cycles to fix them. No need to worry about it. Those visibility files appear to have some generic structure, can we add something to nav2_common to generate that for us? I'm slightly concerned about maintainability and consistency here. Mostly because I'm not a windows developer and adding this stuff here, right now, does enable it, but I'm in future updates / new packages, I'm not going to be well suited to ensuring consistent compatibility. So I'd like for us to come up with some strategy that this is automatically generated or some set of finite and easy to follow rules about what needs to be done to support this. Or if checking in on occasion and fixing up things to work on windows is something you and your team can do. |
@seanyen just following up here |
@SteveMacenski Sorry I didn't get back to you earlier. I ack'ed your concern and I agreed that we should come up with some more sustainable way for the visibility control thing. I will find some time next week to iterate on what I can do by adding something in |
Thanks. If that works out, it would be nice to actually just have a generic tools available to generate this stuff, or have CI generate this stuff and include it in pushes to master. Since Windows is the only OS that seems to need this, its hard for me as a Linux user to really appreciate or debug this. There are (currently) so few windows power-users involved to really help maintain to keep this stuff up and running. I'm all for supporting windows, but I think there needs to be some tooling made available from Microsoft to help us out as maintainers, in the form of automated tooling and testing examples to flag these issues in CI. Since I don't own a Windows or Mac, both of those I rely on tooling or power-users of those OS's to make sure they keep compatible. |
Hi, just following up on this quickly a couple of weeks later. |
@SteveMacenski Sorry for the overdue on the response. I decided to start a new pull request here: #1704. In the new pull request, it is using CMake built-in features to take care of the visibility control and it should largely minimize the maintainer effort keeping the visibility up-to-dated, and in the new pull request, I include all the initial required Windows changes. |
Amazing. Thanks for the attention- I’ll review tomorrow. |
Basic Info
Description of contribution in a few bullet points
Added visibility control for properly building shared library on Windows. https://index.ros.org/doc/ros2/Tutorials/Ament-CMake-Documentation/#building-libraries-on-windows
Corrected the executable and libraries installation location for better portability support. https://index.ros.org/doc/ros2/Tutorials/Ament-CMake-Documentation/#building-a-library
The bottom line is that this change should not break other platform builds.
Description of documentation updates required from your changes
Future work that may be required in bullet points