-
Notifications
You must be signed in to change notification settings - Fork 54
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
find_library: Centralize functionality here #4
Conversation
828f37b
to
2087cfd
Compare
Would you mind updating the README to mention this new utility? |
2087cfd
to
c7ca4ed
Compare
Done. TBH, though, trying to include API + usage documentation in the At what point would there be generated API docs for these pages? (Those API docs could then have more descriptions on usage, examples, etc.) |
Also, I have WIP commits here; if / when this is approved, can I have a chance to curate the commits and get rid of the WIP cruft? |
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'll let Dirk being the final judge there, but a few more ideas / suggestions.
c020e56
to
dd6c0ad
Compare
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.
LGTM 👍
@dirk-thomas actually I am also interested by the answer to Eric's question. Which name should be put in those copyright headers?
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.
What header extensions should I use?
ROS 2 uses .h
/ .c
for C code and .hpp
/ .cpp
for C++ code.
Other code in this repo which doesn't conform to that convention should be updated in a separate PR (FYI @emersonknapp).
What copyright belongs here??
For the code parts which have been moved from other repositories the original copyright should be kept as it was (I assume OSRF). For any newly written code you should probably use your own name/company for the copyright.
The existing code that had the wrong extensions was fixed in #6 |
@EricCousineau-TRI Assuming you also want to remove the implementation from the current location in favor of this central one this change is subject to the upcoming API freeze (May 2nd). If you would like this change to be part of Dashing please update the patch based on the feedback. The branch also needs to be rebased due to other merged PRs in the meantime. |
@@EricCousineau-TRI Friendly ping. |
Sorry for the delay! Addressed comments. Merge commit is a028f34. Will rebase and squash for simplicity. |
bdee68c
to
b575b19
Compare
Done. Trying to fix failures in |
Eh, just copied and pasted license noticed for BSD. For some reason, seemed like it was sensitive to whitespace??? This was the patch that effectively let it pass from Job 6 to Job 7: |
Signed-off-by: Eric Cousineau <eric.cousineau@tri.global>
Ah, oops! Tried fixing it, modeling CMake defs after |
Failed with the following:
Can I ask if you know what the fix is here? |
No |
Signed-off-by: Eric Cousineau <eric.cousineau@tri.global>
Ah, makes sense, thanks! One more time! |
test/test_library.cpp
Outdated
namespace test_library | ||
{ | ||
|
||
RCPPUTILS_PUBLIC |
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 needs an #include
of the header containing the macro definition.
Please rebuild the package locally and run tests when making changes.
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.
Ah... oops! Done.
Signed-off-by: Eric Cousineau <eric.cousineau@tri.global>
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Now the new test fails: https://ci.ros2.org/job/ci_windows/6823/testReport/(root)/projectroot/test_find_library/ |
target_link_libraries(test_find_library ${PROJECT_NAME} test_library) | ||
set_tests_properties(test_find_library PROPERTIES | ||
ENVIRONMENT | ||
"_TEST_LIBRARY_DIR=$<TARGET_FILE_DIR:test_library>;_TEST_LIBRARY=$<TARGET_FILE:test_library>") |
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.
Sigh... I'm thinking that Windows CMake or something else is maybe failing here? (in that it only passes the directly, not the full path?)
I've recently gotten a Windows machine (for another purpose), but will see if I can dig in a bit more.
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.
That being said, thank you for your patience thus far!
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.
Trying to get this setup on Windows, but not being a Windows developer, to try and reproduce this bug is very time consuming and frustrating.
Is there some free Azure container / VM service that has ROS 2 provisioned, that I could possible connect to so that I can debug from there? (For me and other developers, who do not wish to spend time / money setting up Windows environments?)
And can you point me to a unittest that does this sort of thing successfully?
(Something more explicit than saying "Hey, it loaded the library, cool.")
If there isn't one already, I may just shortcut this for now and special-case the Windows logic to pass on CI by acknowledging the current bug (which I'm still confident is CMake, pending any other evidence to the contrary).
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.
Currently the test fails with:
C:\J\workspace\ci_windows\ws\src\ros2\rcpputils\test\test_find_library.cpp(58): error: Expected equality of these values:
test_lib_actual
Which is: "C:/J/workspace/ci_windows/ws/build/rcpputils/Release/test_library.dll"
test_lib_expected
Which is: "C:/J/workspace/ci_windows/ws/build/rcpputils/Release"
Your test code retrieves two environment variables: first the library path then the library dir. But you are missing the fact that the second call overwrites the first variable. See the API documentation of that function: https://github.com/ros2/rcutils/blob/9af59e871e0bfaadb0cbb32014a7167efb9760c0/include/rcutils/get_env.h#L27-L29
So the value of the first environment variable must be copied to its own memory before fetching the second. See ed7b9fa for the fix.
@EricCousineau-TRI are you interested in updating and moving forward with this PR or should we close it out? |
Sorry! I'm interested in moving it forward, but haven't had the chance to focus on it just yet. I should be able to get to it within a couple of months. (I can close it temporarily if it makes it easier for task tracking.) |
No need to close it. I've applied the |
I created #25 which rebased this PR as well as fixes the remaining issue on Windows. Therefore I will go ahead and close this ticket. |
Signed-off-by: Eric Cousineau eric.cousineau@tri.global
Towards #3; downstream PRs:
rcpputils
forfind_library
rmw_implementation#57rcpputils
forfind_library
rosidl_typesupport#47Some questions:
rclcpp
, uses*.hpp
; however, this and other repos sometimes use.h
for C++ code.@dirk-thomas Would you be able to review this bit?
Repositories:
This change is
Addresses #3