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

Could not find directory of OpenSSL installation [cargo test failing in ubuntu 18.04] #505

Closed
ghost opened this issue Aug 22, 2019 · 3 comments · Fixed by #506
Closed

Could not find directory of OpenSSL installation [cargo test failing in ubuntu 18.04] #505

ghost opened this issue Aug 22, 2019 · 3 comments · Fixed by #506

Comments

@ghost
Copy link

ghost commented Aug 22, 2019

Description

Error at building in Ubuntu 18.04

$ uname -a
Linux spectre 5.0.0-25-generic #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Present Behaviour

Command

cargo test --all --release

Output

[...]

   Compiling grpcio-sys v0.4.4
error: failed to run custom build command for `openssl-sys v0.9.49`

Caused by:
  process didn't exit successfully: `/home/ubuntu/dev/prj/lighthouse/target/release/build/openssl-sys-f1abe8a6c3f120f5/build-script-main` (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_GNU_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_GNU_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_GNU_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_GNU_OPENSSL_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
run pkg_config fail: "`\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"` did not exit successfully: exit code: 1\n--- stderr\nPackage openssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `openssl.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'openssl\' found\n"

--- 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-gnu
openssl-sys = 0.9.49

', /home/ubuntu/.cargo/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.

warning: build failed, waiting for other jobs to finish...
error: build failed

OpenSSL is installed in this machine

$ openssl version
OpenSSL 1.1.1  11 Sep 2018

Expected Behaviour

Build is completed and tests are ran.

Steps to resolve

Please, include in the environment docs the following package for Ubuntu

sudo apt-get install libssl-dev 

Related: sfackler/rust-openssl#951

@ghost ghost changed the title Could not find directory of OpenSSL installation [Could not find directory of OpenSSL installation] Could not find directory of OpenSSL installation [cargo test failing in ubuntu 18.04] Aug 22, 2019
paulhauner added a commit that referenced this issue Aug 23, 2019
@paulhauner
Copy link
Member

Thank you!

@ghost ghost closed this as completed Aug 23, 2019
paulhauner added a commit that referenced this issue Aug 27, 2019
@PJ-Finlay
Copy link

I had a similar problem solved with:

sudo apt-get install pkg-config

@paulhauner
Copy link
Member

I had a similar problem solved with:

sudo apt-get install pkg-config

Thanks :) FYI, more deps can be found here: https://lighthouse-book.sigmaprime.io/installation-source.html#dependencies

This issue was closed.
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

Successfully merging a pull request may close this issue.

2 participants