Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want to install cargo-apk cargo install cargo-apk to my system (Linux Mint), but I'm getting this error

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

Caused by:
  process didn't exit successfully: `/tmp/cargo-install7N44TO/release/build/openssl-65bb03053b1fc095/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/jiri/.cargo/registry/src/github.com-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: failed to compile `cargo-apk v0.4.0`, intermediate artifacts can be found at `/tmp/cargo-install7N44TO`

Caused by:
  build failed

I found that I should install libssl-dev, so I did, but it didn't help.

like image 254
Jura Avatar asked Jul 24 '19 12:07

Jura


1 Answers

rust openssl-sys library needs openssl installed.

then on Windows : download and install it from here first : http://slproweb.com/products/Win32OpenSSL.html

then set this EnvironmentVariable:

set OPENSSL_DIR=C:\Program Files\OpenSSL-Win64\

on linux :

sudo apt-get install pkg-config libssl-dev

or

sudo pacman -S openssl

or

sudo dnf install openssl-devel

or

curl -O https://www.openssl.org/source/openssl-1.1.0f.tar.gz tar xf

openssl-1.1.0f.tar.gz cd openssl-1.1.0f export CC=... ./Configure

--prefix=... linux-x86_64 -fPIC make -j$(nproc) make install

and in osx just :

xcode-select --install

brew install openssl

like image 100
benyamin Avatar answered Nov 08 '22 04:11

benyamin