-
Notifications
You must be signed in to change notification settings - Fork 102
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
Use the openssl-sys package to find or compile openssl #92
Conversation
Signed-off-by: Sander van Harmelen <sander@vanharmelen.nl>
Yes! This is a great idea. I never even thought of it. I need a day or two to find time to test, but on a quick look, I'm thinking:
|
Thanks for the feedback, I'll have another go at it tomorrow.
Agree, I think that would make sense.
Sounds good to me.
Check. So then we just keep it like it's done in the current PR, as a dedicated feature 👍
Yep, will do... |
702362a
to
20ba440
Compare
@fpagliughi I just updated the PR with the feedback you gave yesterday. I also updated (renamed) the Additionally I also made the |
bf9bfda
to
70845f8
Compare
I think, for now, I would prefer to keep the |
Check. I’ll revert that part 👍 Are you good with the rest of the PR or do you have any other feedback I need to take into account? |
70845f8
to
8dce2fe
Compare
@fpagliughi reverted the |
@fpagliughi any other things that you want to have updated/changed? Or is this one good to go? |
Sorry, just been slammed with work. I'll have a look within the next few days. |
Ping 😏 |
Hi @fpagliughi, how are things going? Any change to get this one merged? |
Note that I also made the `vendored-ssl` feature enable both the `ssl` and `vendored` features, as otherwise it will not have any effect. Signed-off-by: Sander van Harmelen <sander@vanharmelen.nl>
8dce2fe
to
f629b3b
Compare
reqwest uses the |
Merged manually (to fix conflicts) into the |
Nice 👍🏻 |
I have a use case where I need to cross-compile an app that also depends on the
native-tls
crate. This one depends (eventually) on theopenssl-sys
crate which I use with the featurevendored
. This feature compiles and builds OpenSSL libs which can be statically linked.Now I tried to make the
paho-mqtt-sys
crate use those same libs, but as the path to them is generated dynamically during the build, that is currently not possible. So in this case the only option is to first cross-compile OpenSSL myself and then point to those libs. But that makes it a bit cumbersome if other people checkout the project and want to work on it (they would all have to do the same thing).A possible solution for that could be to make the
paho-mqtt-sys
crate depend on theopenssl-sys
crate, as then we can use the links metadata to get the location and reuse the same libs.This also improves (IMHO) the usability when not cross-compiling or when you don't want to statically link the OpenSSL libs. In those cases it tries to discover the libs on your system and use those instead. Additionally it offers a lot of options to tweak things to your liking making easy for people to build the crate in a way that suits their project.
For the implementation in this PR I chose to add a new feature called
vendored
to thepaho.mqtt.rust
crate that re-exports thepaho-mqqt-sys/vendored
feature which in turn re-exports theopenssl-sys/vendored
feature. While this works very nicely (tested quite a bit both with and without thevendored
feature and with and without cross-compiling), I think it would maybe be nicer to not make a new feature, but instead let it be added to the existingbundled
feature.In cases were people do want to use the
bundled
feature, but do not want to use theopenssl-sys/vendored
feature for some reason, this can still be managed and configured using env vars supported by theopenssl-sys
crate (by settingOPENSSL_NO_VENDOR
). So just let me know if you want me to update the PR to use thebundled
feature instead...