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

Included utils to load, unload and get symbols from shared libraries #215

Merged
merged 35 commits into from
Apr 1, 2020

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Mar 10, 2020

As discussed in this PR ros/class_loader#139. It makes sense to include the logic of loading/unloading shared libraries and symbols in rcutils . These functions will be used in class_loader, rmw_implementation, rosidl_typesupport and rosbag2.

This other PR makes use of this new capability ros/class_loader#139

@ahcorde ahcorde added the enhancement New feature or request label Mar 10, 2020
@ahcorde ahcorde requested a review from wjwwood March 10, 2020 11:10
@ahcorde ahcorde self-assigned this Mar 10, 2020
@ahcorde ahcorde force-pushed the ahcorde/feature/shared_library branch 2 times, most recently from 5bcd3b4 to b29006f Compare March 10, 2020 11:13
Shared library working on Windows

Signed-off-by: ahcorde <ahcorde@gmail.com>
src/shared_library.c Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
Signed-off-by: ahcorde <ahcorde@gmail.com>
src/shared_library.c Outdated Show resolved Hide resolved
Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

I left some requested changes, thanks for factoring it out to this package, I think it will be useful here.

It would be nice to have a stanza in each of the functions like this one:

* <hr>
* Attribute | Adherence
* ------------------ | -------------
* Allocates Memory | No
* Thread-Safe | Yes
* Uses Atomics | No
* Lock-Free | Yes

We may have to just say "* depends on underlying OS functions like dlopen()", etc... but at least it makes people calling these functions think about it when using it, even if it's not a clear yes/no for each.

include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Show resolved Hide resolved
@ahcorde ahcorde force-pushed the ahcorde/feature/shared_library branch 8 times, most recently from 232a58a to 54a0fa5 Compare March 11, 2020 17:12
Signed-off-by: ahcorde <ahcorde@gmail.com>

Added shared library test

fix return error on shared library for windows

Signed-off-by: ahcorde <ahcorde@gmail.com>
@ahcorde ahcorde force-pushed the ahcorde/feature/shared_library branch from 54a0fa5 to e87960b Compare March 11, 2020 17:14
Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

I left some more comments. Also I think at least one of Dirk's comments still need addressing, about the linking in cmake I think.

Thanks for iterating on it!

include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
src/shared_library.c Show resolved Hide resolved
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
dirk-thomas
dirk-thomas previously approved these changes Mar 31, 2020
@ahcorde
Copy link
Contributor Author

ahcorde commented Mar 31, 2020

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
include/rcutils/shared_library.h Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
@dirk-thomas dirk-thomas dismissed their stale review March 31, 2020 18:25

More changes

Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
src/shared_library.c Outdated Show resolved Hide resolved
src/shared_library.c Outdated Show resolved Hide resolved
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
Copy link
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

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

With passing CI.

@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 1, 2020

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit 35f2985 into master Apr 1, 2020
@delete-merged-branch delete-merged-branch bot deleted the ahcorde/feature/shared_library branch April 1, 2020 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants