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

cargo-c integration and dynamic linking #3786

Closed
kpcyrd opened this issue Nov 19, 2024 · 3 comments · Fixed by #3787
Closed

cargo-c integration and dynamic linking #3786

kpcyrd opened this issue Nov 19, 2024 · 3 comments · Fixed by #3787
Labels
A-ffi Area: ffi (C API) C-feature Category: feature. This is adding a new feature.

Comments

@kpcyrd
Copy link

kpcyrd commented Nov 19, 2024

Is your feature request related to a problem? Please describe.
I'm trying to get the FFI interface of hyper up to speed with rustls-ffi, for integration in an operating system.

Compare the current curl hyper documentation (which wants you to manually build and link cdylib objects) to the current curl rustls documentation (that generates and installs a .so file, headers and and pkg-config integration for you @cpu has pointed out this document is not using cargo-c, the rustls-ffi pull request linked below is a better resource to look into).

Most of the work to get rustls to this point was done in this pull request: rustls/rustls-ffi#274

Describe the solution you'd like
I'd like hyper to integrate with the pkg-config ecosystem that Linux distributions build upon, preferably through cargo-c.

Describe alternatives you've considered
The curl hyper integration is currently planned for removal in January 2025.

Additional context
There may be some additional context in rustls/rustls-ffi#345.

There was development work done on cargo-c itself specifically for rustls-ffi that you may want to consider, in case you have concerns about dynamic linking and ABI stability: lu-zero/cargo-c#345

@kpcyrd kpcyrd added the C-feature Category: feature. This is adding a new feature. label Nov 19, 2024
@seanmonstar seanmonstar added the A-ffi Area: ffi (C API) label Nov 19, 2024
@cpu
Copy link

cpu commented Nov 19, 2024

For what it's worth I've been happy with cargo-c and the upstream maintainers have been very helpful. In rustls-ffi I'm moving towards replacing the old Makefile approach (as linked to from the current curl docs) and instead recommending cargo-c as the blessed path for building the library (static or dynamic).

@seanmonstar
Copy link
Member

I've installed cargo-c locally and tried it out, seems like the only thing that is missing is adding a capi feature, and perhaps some options to use the pre-existing header file, and... that's it?

@seanmonstar
Copy link
Member

Started #3787.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ffi Area: ffi (C API) C-feature Category: feature. This is adding a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants