-
Notifications
You must be signed in to change notification settings - Fork 11
wolfssl-sys: provide library paths to downstream crates, allow enabling some optional features #225
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
base: main
Are you sure you want to change the base?
Conversation
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.
Changes look good. Thanks for the contribution.
Our CI is configured to use Earthly satellites, which will not be enabled for forked projects. |
I have merged a fix to run CI in github runners instead of earthly satellite. Can you please rebase your branch on top of main ? |
Exporting root and include metadata of wolfssl allows other C library binding crates to link/build their C libraries to/for the same version of wolfssl as the wolfssl-sys crate, which helps prevent linking multiple versions of the same libraries at once.
4515216
to
77d6f00
Compare
Done. I also ran Thanks for the quick reply! |
77d6f00
to
97414f6
Compare
Apparently, the To fix this (and avoid disabling a previously enabled-by-default feature, which would probably constitute a breaking change), I've removed the optional feature, and it should now always be enabled again. |
97414f6
to
529b3a5
Compare
529b3a5
to
8567a55
Compare
@pulsastrix There is one more fix needed for enabling external contributors. Can you please rebase once again ? |
This PR makes two changes to wolfssl-sys that allow downstream crates to...
A) ...determine the path of the the linked version of wolfSSL. This allows downstream crates that themselves link against C libraries to build and link those against the same version of wolfSSL that is used by this crate (avoiding linking to multiple instances of wolfSSL at once).
To do so, the build script now prints some extra metadata which is then passed to dependent crates by cargo, see https://doc.rust-lang.org/cargo/reference/build-script-examples.html#using-another-sys-crate.
B) ...enable some optional features in wolfSSL. While those are not required for wolfssl-rs, dependent C libraries may need them to be available. For now, I have limited this to features that are required for my own use case (see below), but this could of course also be expanded to all other optional features if necessary.
An example use case for the changes in this PR would be linking the
libcoap
binding cratelibcoap-rs
to this crate's version of wolfSSL: namib-project/libcoap-rs#45