-
Notifications
You must be signed in to change notification settings - Fork 642
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
Create dynamic libraries with C interfaces for Dart FFI #3098
Conversation
6b2e90f
to
b1b1eb9
Compare
Codecov Report
@@ Coverage Diff @@
## desktop-gui #3098 +/- ##
==============================================
Coverage ? 88.48%
==============================================
Files ? 239
Lines ? 12107
Branches ? 0
==============================================
Hits ? 10713
Misses ? 1394
Partials ? 0 |
a159520
to
16a7fec
Compare
16a7fec
to
41a2ba0
Compare
28b9394
to
97092b2
Compare
41a2ba0
to
e2b2664
Compare
97092b2
to
cdac76c
Compare
e2b2664
to
fc95786
Compare
cdac76c
to
20c1e44
Compare
fc95786
to
6d8b724
Compare
20c1e44
to
5dfd0bd
Compare
6d8b724
to
2bf493c
Compare
5dfd0bd
to
2a08190
Compare
2bf493c
to
a11ec29
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.
Hey @andrei-toterman! Great job here. I see us using extensively this library in the future, so we'd need to be careful in the design. But until now, I don't see any flaws in design nor in code. So please rebase the base branch from main and make sure this will merge fine into it, answer please the few questions and we are good to go!
@@ -74,7 +74,7 @@ auto make_handler_unregisterer(mp::SettingsHandler* handler) | |||
} // namespace | |||
|
|||
mp::Client::Client(ClientConfig& config) | |||
: stub{mp::Rpc::NewStub(mp::client::make_channel(config.server_address, config.cert_provider.get()))}, | |||
: stub{mp::Rpc::NewStub(mp::client::make_channel(config.server_address, *config.cert_provider))}, |
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.
Isn't this config->cert_provider
?
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 don't think so. We need to pass a reference to make_channel
and cert_provider
in this case is a unique_ptr
, so we need *
to get that reference.
mp::CertProvider* cert_provider) | ||
const mp::CertProvider& cert_provider) |
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 thnk this interface update is a drive-by change. But nevermind, it's a good change so I'm perfectly OK with it.
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.
Yeah, we could've kept the pointer but since after this refactoring we never pass a null pointer to this function, we can use a reference instead for more safety
@@ -86,6 +86,7 @@ option(YAML_CPP_BUILD_CONTRIB OFF) | |||
option(YAML_CPP_BUILD_TESTS OFF) | |||
|
|||
add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL) | |||
set_target_properties(yaml-cpp PROPERTIES POSITION_INDEPENDENT_CODE ON) |
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.
Why do we need PIC here? Anyway, I'm OK with it, especially because it's third party. Just asking out of curiosity.
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.
Without it, I was simply getting a compilation error that said it needs PIC to compile some functions in that library :)
255f615
to
3b57f26
Compare
0b6bc3e
to
65a3e68
Compare
3b57f26
to
a3372f2
Compare
65a3e68
to
3c0494b
Compare
a3372f2
to
d05952f
Compare
3c0494b
to
78ac095
Compare
820a85c
to
642accf
Compare
a56949c
to
2220a61
Compare
642accf
to
91bf677
Compare
91bf677
to
dfa919c
Compare
dfa919c
to
239d612
Compare
bors r+ |
3098: Create dynamic libraries with C interfaces for Dart FFI r=luis4a0 a=andrei-toterman This PR adds a new shared library called `dart_ffi` which contains C interfaces of some of our C++ functions which we'd like to call from Dart using FFI. Some additional refactoring was needed in order decouple the generation of certificates from the creation of the gRPC channel, so that certificate data can be more easily retrieved using a C interface. Co-authored-by: Andrei Toterman <[email protected]>
bors cancel |
Canceled. |
This PR adds a new shared library called
dart_ffi
which contains C interfaces of some of our C++ functions which we'd like to call from Dart using FFI.Some additional refactoring was needed in order decouple the generation of certificates from the creation of the gRPC channel, so that certificate data can be more easily retrieved using a C interface.