-
-
Notifications
You must be signed in to change notification settings - Fork 760
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
Can't build for musl on Linux #603
Comments
You can use |
Hmmm the problem is it looks for
It works with the non-musl target though. Maybe I need to link |
Yeah that seemed to do the trick. Although now |
I'm confused - if you're cross-compiling to MUSL, you'll probably need an OpenSSL cross-compiled for MUSL as well. If you're not cross-compiling, pkg-config will handle all of this configuration for you when using the normal Ubuntu OpenSSL install. |
Ah yes good point. I give up! |
Note to anyone who comes across an error like this in the future - I was able to get this to work by building openssl-1.0.2l from source. Make sure that whatever path you give to * ** or perhaps a crate that depends it such as |
Confirming that same error happens on Ubuntu 17.10 with openssl-sys v0.9.27. |
I just landed on this ticket looking for a way to build |
@parasyte thank you so much for mentioning that here, works like a charm. |
@parasyte thanks for saving my life. Been searching to compile my app with the rust official image and keep crashing on openssl. This image works like a charm |
I solved this with |
// only the default-tls cargo tree // both since features are additive cargo tree --features rustls-tls // only rustls-tls cargo tree --features rustls-tls --no-default-features closes #889 ## Motivation Bellow is verbatim copy from issue #889 created by @msdinit We are building our application against musl, cross-compiling it from regular libc Ubuntu. However, we are having issues with svix client, because it depends on system OpenSSL, which in our case would be linked against libc. There sfackler/rust-openssl#603, but they are a bit involved. ## Solution Added cargo features allowing users to choose which ssl version to use for svix reqwest http client, keeping backwards compatibility.
// only the default-tls cargo tree // both since features are additive cargo tree --features rustls-tls // only rustls-tls cargo tree --features rustls-tls --no-default-features closes #889 ## Motivation Bellow is verbatim copy from issue #889 created by @msdinit We are building our application against musl, cross-compiling it from regular libc Ubuntu. However, we are having issues with svix client, because it depends on system OpenSSL, which in our case would be linked against libc. There sfackler/rust-openssl#603, but they are a bit involved. ## Solution Added cargo features allowing users to choose which ssl version to use for svix reqwest http client, keeping backwards compatibility.
I'm trying to build something that uses rust-openssl on Ubuntu 16.04 using the -musl target.
First when I build it it tells me to
export PKG_CONFIG_ALLOW_CROSS=1
. Not sure why but whatever; I did it.Unfortunately then it seems to have trouble finding the OpenSSL headers. I installed them with
sudo apt install libssl-dev
.You can do
export OPENSSL_DIR=/usr/include/x86_64-linux-gnu
and then it finds the headers, however then you get this error:The text was updated successfully, but these errors were encountered: