-
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
OPENSSL_STATIC from openssl-sys is not respected #113
Comments
Hi @rajivshah3, you need to use/enable the |
Thanks, I saw that but I think it may complicate things for us. The docs for
|
Ah, I see... Must admit that I'm not sure about that one without have a closer look first... |
Yes, I noticed that, too, the other day. The behavior should be consistent, and we should not have to build the vendored SSL to get static linking, |
It looks like this is an issue with the openssl-sys build. There are a few mentions on the Internet: https://users.rust-lang.org/t/how-to-link-openssl-statically/14912/17 It seems that if openssl-sys finds the library via the package manager, then the build script drops out before checking
Although it's not clear if that will fix things or create other problems. |
Oops. Looks like there's more I need to do as well. From the current build, even when OPENSSL_STATIC=1:
Despite the openssl-sys doing it correctly, if the
Seems that the build for the paho library needs to check the flag as well and add the |
Thanks for including
openssl-sys
! It makes our lives easier as we're building an app for macOS, Windows, and Linux and setting the environment variables can get annoying 😄 . However, we also need to be able to link statically, butpaho-mqtt
seems to keep linking OpenSSL dynamically.openssl-sys
allows us to use static linking by settingOPENSSL_STATIC=1
which works fine forrust-openssl
'ssystest
, for example:However, when building the example project with
OPENSSL_STATIC=1
, OpenSSL is still dynamically linked:If I had to take a guess, it seems like OpenSSL is getting linked twice (dynamically and statically), but I haven't looked into the issue fully yet. Is this code necessary now that the linking is handled by
openssl-sys
?https://github.com/eclipse/paho.mqtt.rust/blob/798b151fa6c1ff1df0f18f90c8f98633ee29825f/paho-mqtt-sys/build.rs#L269-L292
The text was updated successfully, but these errors were encountered: