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

Build Failed: openssl-sys #400

Closed
chrisabruce opened this issue Mar 29, 2020 · 6 comments
Closed

Build Failed: openssl-sys #400

chrisabruce opened this issue Mar 29, 2020 · 6 comments
Labels

Comments

@chrisabruce
Copy link

Not sure what I am doing wrong, but I can't get cross to work with openssl-sys crate.

I have tried both aarch64-unknown-linux-gnu and aarch64-unknown-linux-musl

Any suggestions?

cross build --target aarch64-unknown-linux-gnu
   Compiling openssl-sys v0.9.54
   Compiling sct v0.5.0
   Compiling webpki v0.19.1
   Compiling futures-util v0.3.4
   Compiling tokio-util v0.2.0
   Compiling serde_urlencoded v0.6.1
   Compiling serde_json v1.0.48
   Compiling failure v0.1.7
   Compiling uuid v0.7.4
   Compiling xsd-types v0.1.0 (https://github.com/lumeohq/xsd-parser-rs?rev=05cd3be1#05cd3be1)
   Compiling flexi_logger v0.15.2
   Compiling tokio v0.1.22
error: failed to run custom build command for `openssl-sys v0.9.54`

Caused by:
  process didn't exit successfully: `/target/debug/build/openssl-sys-5b14a6ca64ca7ff2/build-script-main` (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
AARCH64_UNKNOWN_LINUX_GNU_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 = aarch64-unknown-linux-gnu
openssl-sys = 0.9.54

', /cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.54/build/find_normal.rs:150:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

warning: build failed, waiting for other jobs to finish...
error: build failed
@chrisabruce
Copy link
Author

Ok catching up and now seeing Issue #229.

@chrisabruce
Copy link
Author

Ok closing this issue as it seems that this project no longer wants to support openssl. For anyone that lands here, take a look at #229 and for a work around look at: #229 (comment)

Hopefully, there will be some longer-term ability to cross-compile projects that need openssl.

@ln-12
Copy link

ln-12 commented Sep 29, 2022

I also came across this problem when I tried to build for armv7. I used this guide as starting point and had to add libssl-dev libssl-dev:armhf to the apt install command. Before, I just installed libssl-dev which was not enough. Maybe this hint is useful for someone (in the future).

@Emilgardis
Copy link
Member

This is also documented on our wiki: https://github.com/cross-rs/cross/wiki/Recipes#openssl

@ln-12
Copy link

ln-12 commented Sep 29, 2022

Thanks for the hint, I did not find that page before.

@pando85
Copy link

pando85 commented Nov 20, 2024

For people trying to use the vendored way I ended with:

[dependencies]
...
openssl = { version = '*', features = ["vendored"] }

[build-dependencies]
openssl = { version = '*', features = ["vendored"] }

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

No branches or pull requests

5 participants