Skip to content
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

Is it possible to remove the openssl dependency? Trying to use reqwest in Firecracker (musl, built in a container) #647

Closed
hfingler opened this issue Sep 20, 2019 · 2 comments

Comments

@hfingler
Copy link

I'm trying to use reqwest from inside Firecracker and, when I add reqwest to it, if it's a relatively new version, I get a dependency hell. By using any version, which resolves to 0.8.5, I get a openssl dependency problem (output is below).

The thing is, Firecracker is built inside a container and with musl which makes things a little harder. Is it possible to remove this dependency, maybe use rustls instead? The solution I've found (sfackler/rust-openssl#980) talks about the vendored approach, but it didn't work for me, maybe I did something wrong.

I guess it would be possible to either modify the container image to install/compile openssl against musl, but I'd like not to change something that important.

Thanks

error: failed to run custom build command for `openssl-sys v0.9.49`
process didn't exit successfully: `/firecracker/build/cargo_target/debug/build/openssl-sys-f900db53e43d4cae/build-script-main` (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR
X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
run pkg_config fail: "Cross compilation detected. Use PKG_CONFIG_ALLOW_CROSS=1 to override"

--- stderr
thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

If you're in a situation where you think the directory *should* be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu
$TARGET = x86_64-unknown-linux-musl
openssl-sys = 0.9.49

', /usr/local/rust/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.49/build/find_normal.rs:150:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
@seanmonstar
Copy link
Owner

Yes, you can disable the default features (which is just default-tls), and enable rustls-tls.

@mbhall88
Copy link

Yes, you can disable the default features (which is just default-tls), and enable rustls-tls.

Excuse me if I've missed it somewhere, but it would be greatly appreciated if this could be documented somewhere as removing OpenSSL dependency is probably a reasonably common use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants