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

error: failed to run custom build command for openssl v0.9.24 at ubuntu 20 #1436

Closed
abdelmonem17 opened this issue Mar 16, 2021 · 13 comments
Closed

Comments

@abdelmonem17
Copy link

abdelmonem17 commented Mar 16, 2021

Hello everyone I made a project under windows OS and built it then try to build it under linux ubuntu but the build aborted and I have the following issue although I have openssl last version installed, can anyone help me to fix this?

error: failed to run custom build command for openssl v0.9.24

Caused by:
process didn't exit successfully: /home/abdelmonem/Desktop/website/website/target/debug/build/openssl-e87e3c00af340f2c/build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

@sfackler
Copy link
Owner

That version of the openssl crate is over 3 years old, and doesn't support OpenSSL 1.1.1.

@abdelmonem17
Copy link
Author

abdelmonem17 commented Mar 16, 2021

@sfackler So which version can I install instead of OpenSSL 1.1.1?

@sfackler
Copy link
Owner

1.0.1, 1.0.2, or 1.1.0. However, you should probably instead update your Rust dependencies to pull in a more modern version of the openssl crate.

@abdelmonem17
Copy link
Author

unfortunately I am not directly use openssl crate instead I use creates which use openssl

@abdelmonem17
Copy link
Author

@sfackler I installed OpenSSL 1.0.1s 1 Mar 2016
but I still have the same error, also I refered to openssl_dir and lib

note that this project compile without problems at windows 10 with OpenSSL 1.1.1i 8 Dec 2020

@sfackler
Copy link
Owner

What is the exact way you tried to build with 1.0.1, and what is the exact error you got?

@abdelmonem17
Copy link
Author

I install openssl like this

sudo wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1s.tar.gz --no-check-certificate

and installed the downloaded file then I try to compile the project through cargo build and from clion IDE and I have the same error :

process didn't exit successfully: /home/abdelmonem/Desktop/website/website/target/debug/build/openssl-e87e3c00af340f2c/build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

@sfackler
Copy link
Owner

That contains the source code of OpenSSL. You need to compile it.

@abdelmonem17
Copy link
Author

abdelmonem17 commented Mar 16, 2021

@sfackler

That contains the source code of OpenSSL. You need to compile it.

I already compiled it and installed it finally finally copied the openssl excitable to /user/local/bin
also I set the following environment variables

export OPENSSL_INCLUDE_DIR=/usr/include/openssl
export OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
export OPENSSL_DIR=/usr/bin

@sfackler
Copy link
Owner

Does /usr/include/openssl contain the headers for the OpenSSL you built? Copying it over your system-provided OpenSSL is a really bad idea BTW.

@abdelmonem17
Copy link
Author

I installed OpenSSL 1.0.1e 11 Feb 2013

and pointed to the openssl using
export OPENSSL_INCLUDE_DIR=/usr/local/src/openssl-1.0.1e/include/
export OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
export OPENSSL_DIR=/usr/local/ssl/bin/

and compiled but I have linker error at the end like that and out to me when using openssl-1.0.2o version

/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.10.33/src/ssl/mod.rs:316: undefined reference to SSLv23_method' /usr/bin/ld: /home/abdelmonem/Desktop/website/website/target/debug/deps/libopenssl-4646c0f2fad353f2.rlib(openssl-4646c0f2fad353f2.openssl.44n0sz0v-cgu.0.rcgu.o): in function openssl::ssl::SSL_CTX_up_ref':
/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.10.33/src/ssl/mod.rs:4086: undefined reference to CRYPTO_add_lock' /usr/bin/ld: /home/abdelmonem/Desktop/website/website/target/debug/deps/libopenssl-4646c0f2fad353f2.rlib(openssl-4646c0f2fad353f2.openssl.44n0sz0v-cgu.0.rcgu.o): in function openssl::ssl::get_new_idx':
/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.10.33/src/ssl/mod.rs:4174: undefined reference to SSL_CTX_get_ex_new_index' /usr/bin/ld: /home/abdelmonem/Desktop/website/website/target/debug/deps/libopenssl-4646c0f2fad353f2.rlib(openssl-4646c0f2fad353f2.openssl.44n0sz0v-cgu.0.rcgu.o): in function openssl::ssl::get_new_idx::{{closure}}':
/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.10.33/src/ssl/mod.rs:4171: undefined reference to SSL_CTX_get_ex_new_index' /usr/bin/ld: /home/abdelmonem/Desktop/website/website/target/debug/deps/libopenssl-4646c0f2fad353f2.rlib(openssl-4646c0f2fad353f2.openssl.44n0sz0v-cgu.0.rcgu.o): in function openssl::ssl::get_new_ssl_idx':
/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.10.33/src/ssl/mod.rs:4184: undefined reference to SSL_get_ex_new_index' /usr/bin/ld: /home/abdelmonem/Desktop/website/website/target/debug/deps/libopenssl-4646c0f2fad353f2.rlib(openssl-4646c0f2fad353f2.openssl.44n0sz0v-cgu.0.rcgu.o): in function openssl::ssl::get_new_ssl_idx::{{closure}}':
/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.10.33/src/ssl/mod.rs:4181: undefined reference to SSL_get_ex_new_index' /usr/bin/ld: /home/abdelmonem/Desktop/website/website/target/debug/deps/libopenssl-4646c0f2fad353f2.rlib(openssl-4646c0f2fad353f2.openssl.44n0sz0v-cgu.13.rcgu.o): in function <openssl::stack::Stack as core::ops::drop::Drop>::drop':
/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-0.10.33/src/stack.rs:61: undefined reference to sk_free' /usr/bin/ld: /home/abdelmonem/Desktop/website/website/target/debug/deps/libopenssl-4646c0f2fad353f2.rlib(openssl-4646c0f2fad353f2.openssl.44n0sz0v-cgu.13.rcgu.o): in function openssl::stack::StackRef::len':
......
........
....
/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.61/src/lib.rs:167: undefined reference to SSL_library_init' /usr/bin/ld: /home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.61/src/lib.rs:168: undefined reference to SSL_load_error_strings'
/usr/bin/ld: /home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.61/src/lib.rs:169: undefined reference to OPENSSL_add_all_algorithms_noconf' /usr/bin/ld: /home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.61/src/lib.rs:171: undefined reference to CRYPTO_num_locks'
/usr/bin/ld: /home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.61/src/lib.rs:181: undefined reference to CRYPTO_set_locking_callback' /usr/bin/ld: /home/abdelmonem/Desktop/website/website/target/debug/deps/libopenssl_sys-df9de550a33d57b8.rlib(openssl_sys-df9de550a33d57b8.openssl_sys.an8kjbpp-cgu.6.rcgu.o): in function openssl_sys::init::set_id_callback':
/home/abdelmonem/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/openssl-sys-0.9.61/src/lib.rs:156: undefined reference to `CRYPTO_set_id_callback'
collect2: error: ld returned 1 exit status

@sfackler
Copy link
Owner

You are pointing to the headers in one place, and libraries in an entirely different place. Both of those should point to one specific and consistent installation.

Also, I would not recommend using a release of OpenSSL from 8 years ago.

@1271
Copy link

1271 commented Mar 23, 2021

@abdelmonem17
If the problem is still relevant. Please make sure you have pkg-config

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