wolfssl-sys: provide library paths to downstream crates, allow enabling some optional features#225
Conversation
kp-mariappan-ramasamy
left a comment
There was a problem hiding this comment.
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 ? |
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. |
529b3a5 to
8567a55
Compare
|
@pulsastrix There is one more fix needed for enabling external contributors. Can you please rebase once again ? |
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.
8567a55 to
6b58661
Compare
I missed updating the version when I merged this PR #225
I missed updating the version when I merged this PR #225
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
libcoapbinding cratelibcoap-rsto this crate's version of wolfSSL: namib-project/libcoap-rs#45