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

Install / Build failure for openssl-sys - Included Resolution #29

Closed
jmb12686 opened this issue Aug 24, 2019 · 3 comments
Closed

Install / Build failure for openssl-sys - Included Resolution #29

jmb12686 opened this issue Aug 24, 2019 · 3 comments
Labels
build error Anything related to failed builds (any platform)

Comments

@jmb12686
Copy link

When following the install instructions, I received the following error during the cargo install:

johnbelisle@JOHN-SURFACEP3:~/tools/monolith$ cargo install --path .                                                                                                             Installing monolith v2.0.8 (/home/johnbelisle/tools/monolith)                                                                                                                   Updating crates.io index                                                                                                                                                     Compiling openssl-sys v0.9.49                                                                                                                                                 Compiling rand_pcg v0.1.2                                                                                                                                                     Compiling rand_chacha v0.1.1                                                                                                                                                  Compiling memoffset v0.5.1                                                                                                                                                 error: failed to run custom build command for `openssl-sys v0.9.49`                                                                                                                                                                                                                                                                                         Caused by:                                                                                                                                                                      process didn't exit successfully: `/home/johnbelisle/tools/monolith/target/release/build/openssl-sys-acc6cf0f5e926ccc/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
                                                                                                                                                                              Caused by:                                                                                                                                                                      build failed                                                                                                                                                               

I was able to resolve by installing libssl-dev on my Ubuntu env (Win10 WSL Ubuntu 18 LTS to be exact):

sudo apt install libssl-dev 

Install was successful after this. I'm a newb with respect to Rust and the ecosystem, but this documentation may help others experiencing the same issue. Maybe it would be a good idea to consider including this as a pre-requisite or part of some install step? Ideally it would be a pre-check during cargo install time?

Thanks!

@snshn snshn added the build error Anything related to failed builds (any platform) label Aug 25, 2019
@snshn snshn closed this as completed Apr 28, 2020
@einarpersson
Copy link

I stumbled upon this as well. I recommend to just add a brief note about it in the README.

Thanks for this project btw!

@snshn
Copy link
Member

snshn commented Nov 25, 2022

@einarpersson glad it's useful! Currently there's "Dependency: libssl" in the README under "From source code" section, please let me know if you think it's sufficient, or if it can be done in a clearer way, that is cross-platform. Thank you for the feedback!

@einarpersson
Copy link

@einarpersson glad it's useful! Currently there's "Dependency: libssl" in the README under "From source code" section, please let me know if you think it's sufficient, or if it can be done in a clearer way, that is cross-platform. Thank you for the feedback!

Isn't the issue here that the "Dependency: libssl" is only in the "build from source"-section, whereas me and the OP used cargo install. I'm not too experienced with rust, so maybe this is in fact building from source, but as a newcomer it is easy to expect it to not realize this.

Suggestions:

  1. Add a notice to the installation methods which require libssl (and maybe give an example of how to install it on common platforms)
  2. If all methods require it, bring the pre-requisite before installation methods and maybe with a clearer header eg. "Before you start"

This is not a big issue, but it might save some headache for some people:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build error Anything related to failed builds (any platform)
Projects
None yet
Development

No branches or pull requests

3 participants