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

Ubuntu 18.04 failed to run custom build command for `openssl-sys v0.9.35` #1065

Closed
trecement opened this Issue Feb 21, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@trecement
Copy link

trecement commented Feb 21, 2019

Trying to run Docker image built locally
(https://github.com/maidsafe/safe_vault/blob/master/Dockerfile)

pkg-config libssl-dev are installed OK
$HOST = x86_64-alpine-linux-musl
$TARGET = x86_64-alpine-linux-musl
openssl-sys = 0.9.35

.............
Compiling tokio-timer v0.2.1
Compiling idna v0.1.4
error: failed to run custom build command for openssl-sys v0.9.35
process didn't exit successfully: /home/maidsafe/src/safe_vault/target/release/build/openssl-sys-29624bec371f6aa0/build-script-main (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=X86_64_ALPINE_LINUX_MUSL_OPENSSL_LIB_DIR
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
cargo:rerun-if-env-changed=X86_64_ALPINE_LINUX_MUSL_OPENSSL_INCLUDE_DIR
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
cargo:rerun-if-env-changed=X86_64_ALPINE_LINUX_MUSL_OPENSSL_DIR
cargo:rerun-if-env-changed=OPENSSL_DIR
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\nPackage 'openssl', required by 'virtual:world', not 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-alpine-linux-musl
$TARGET = x86_64-alpine-linux-musl
openssl-sys = 0.9.35

', /home/maidsafe/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.35/build/main.rs:265:9
note: Run with RUST_BACKTRACE=1 for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
./installer/docker/docker-entrypoint.sh: line 333: ./safe_vault: No such file or directory
willie@gagarin:/projects/maidsafe/dockerstuff/safe_vault$ openssl version -d
OPENSSLDIR: "/usr/lib/ssl"
willie@gagarin:
/projects/maidsafe/dockerstuff/safe_vault$ echo $OPENSSL_DIR
/usr/lib/ssl
willie@gagarin:/projects/maidsafe/dockerstuff/safe_vault$ echo $PKG_CONFIG_PATH
/usr/lib/x86_64-linux-gnu/pkgconfig/
willie@gagarin:
/projects/maidsafe/dockerstuff/safe_vault$ locate openssl.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/openssl.pc
willie@gagarin:/projects/maidsafe/dockerstuff/safe_vault$ openssl version
OpenSSL 1.1.0g 2 Nov 2017
willie@gagarin:
/projects/maidsafe/dockerstuff/safe_vault$ sudo apt-get install pkg-config libssl-dev
[sudo] password for willie:
Reading package lists... Done
Building dependency tree
Reading state information... Done
pkg-config is already the newest version (0.29.1-0ubuntu2).
pkg-config set to manually installed.
libssl-dev is already the newest version (1.1.0g-2ubuntu4.3).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

@trecement

This comment has been minimized.

Copy link
Author

trecement commented Feb 21, 2019

I have no idea why some lines above are strikethrough

willie@gagarin:~/projects/maidsafe/dockerstuff/safe_vault$ openssl version -d
OPENSSLDIR: "/usr/lib/ssl"
willie@gagarin:~/projects/maidsafe/dockerstuff/safe_vault$ echo $OPENSSL_DIR
/usr/lib/ssl
willie@gagarin:~/projects/maidsafe/dockerstuff/safe_vault$ echo $PKG_CONFIG_PATH
/usr/lib/x86_64-linux-gnu/pkgconfig/
willie@gagarin:~/projects/maidsafe/dockerstuff/safe_vault$ locate openssl.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/openssl.pc
willie@gagarin:~/projects/maidsafe/dockerstuff/safe_vault$ openssl version
OpenSSL 1.1.0g  2 Nov 2017
@sfackler

This comment has been minimized.

Copy link
Owner

sfackler commented Feb 21, 2019

What does pkg-config --libs openssl print?

@trecement

This comment has been minimized.

Copy link
Author

trecement commented Feb 22, 2019

Thank you for the prompt reply..

willie@gagarin:~$ pkg-config --libs openssl
-lssl -lcrypto

@sfackler

This comment has been minimized.

Copy link
Owner

sfackler commented Feb 22, 2019

Are you running that in the Docker environment or your own environment?

Whatever place the cargo build command is run is missing the openssl pkg-config file.

@trecement

This comment has been minimized.

Copy link
Author

trecement commented Feb 22, 2019

Sorry for delay.
I ran the pkg-config command in my own environment.
The build process fails before I can get to a command prompt in the docker environment. I am barely familiar/competent with docker but I'm guessing I should be setting these env variables in the Dockerfile

@sfackler

This comment has been minimized.

Copy link
Owner

sfackler commented Feb 22, 2019

You probably just need to have openssl-dev installed in the Docker image.

@calumcraig

This comment has been minimized.

Copy link

calumcraig commented Mar 1, 2019

pkg-config --libs openssl returns:

Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'openssl', required by 'virtual:world', not found

After I get shell access to the container.
So, yes, seems we don't have openssl installed in the container - need to figure out how to do this (I am not a Docker expert...).

@sfackler sfackler closed this Mar 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.