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

2

11

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.

Eruptive answered 24/7, 2019 at 12:8 Comment(0)
M
6

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

Makepeace answered 10/10, 2020 at 7:10 Comment(4)
i already have openssl installed and still got this build errorCarniola
@Carniola what is your os? is openssl in your PATH?Makepeace
so do i need to put the /usr/bin/openssl into $PATH ? that should fix the issue ?Carniola
@Carniola you should give it a try, i think it does.Makepeace
J
0

I faced similar issue in Windows. Steps I did to resolve the issue.

  1. Install cygwin - https://www.cygwin.com/
  2. Install perl(from cygwin bash terminal) - https://learn.perl.org/installing/windows.html
  3. Then tried cargo install from cygwin bash terminal.
Juno answered 16/2, 2022 at 6:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.