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: failed to run custom build command for openssl-sys v0.9.39 #1021

Closed
karasjoh000 opened this issue Nov 24, 2018 · 29 comments
Closed

Ubuntu 18: failed to run custom build command for openssl-sys v0.9.39 #1021

karasjoh000 opened this issue Nov 24, 2018 · 29 comments

Comments

@karasjoh000
Copy link

@karasjoh000 karasjoh000 commented Nov 24, 2018

installed libssl-dev on ubuntu 18 and still get this error:
error: failed to run custom build command for openssl-sys v0.9.39
process didn't exit successfully: /home/forecast/cs453_finalproj_backend/target/release/build/openssl-sys-864259d0b1f702fc/build-script-main (exit code: 101)

@karasjoh000
Copy link
Author

@karasjoh000 karasjoh000 commented Nov 24, 2018

might be same as #994 but too many comments there, can't find what will actually work

1.1.0g-2ubuntu4.1

@sfackler
Copy link
Owner

@sfackler sfackler commented Nov 24, 2018

What does the rest of the error message say? In particular, you need pkg-config installed.

@karasjoh000
Copy link
Author

@karasjoh000 karasjoh000 commented Nov 24, 2018

elease
Compiling openssl-sys v0.9.39
error: failed to run custom build command for openssl-sys v0.9.39
process didn't exit successfully: /home/forecast/cs453_finalproj_backend/target/release/build/openssl-sys-864259d0b1f702fc/build-script-main (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
cargo:rerun-if-env-changed=OPENSSL_DIR
run pkg_config fail: "Failed to run \"pkg-config\" \"--libs\" \"--cflags\" \"openssl\": No such file or directory (os error 2)"

--- 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-unknown-linux-gnu
$TARGET = x86_64-unknown-linux-gnu
openssl-sys = 0.9.39

It looks like you're compiling on Linux and also targeting Linux. Currently this
requires the pkg-config utility to find OpenSSL but unfortunately pkg-config
could not be found. If you have OpenSSL installed you can likely fix this by
installing pkg-config.

', /home/forecast/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.39/build/main.rs:269:9
stack backtrace:
0: std::sys::unix::backtrace::tracing:👿:unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:211
3: std::panicking::default_hook
at src/libstd/panicking.rs:227
4: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:476
5: std::panicking::begin_panic
6: build_script_main:👿:get_openssl
7: build_script_main::main
8: std::rt::lang_start::{{closure}}
9: std::panicking::try::do_call
at src/libstd/rt.rs:59
at src/libstd/panicking.rs:310
10: __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:102
11: std::rt::lang_start_internal
at src/libstd/panicking.rs:289
at src/libstd/panic.rs:398
at src/libstd/rt.rs:58
12: main
13: __libc_start_main
14: _start

@karasjoh000
Copy link
Author

@karasjoh000 karasjoh000 commented Nov 24, 2018

so how do I configure pkg-config

@karasjoh000
Copy link
Author

@karasjoh000 karasjoh000 commented Nov 24, 2018

Works now, ran sudo apt install pkg-config

@agryaznov
Copy link

@agryaznov agryaznov commented May 20, 2019

Works now, ran sudo apt install pkg-config

Didn't help in my case. What helped was to get that openssl library sources and build it ourselves

See the full list of commands here

@ssainball
Copy link

@ssainball ssainball commented Sep 29, 2019

Works now, ran sudo apt install pkg-config

Thank you very much. from Korea.

@lechatthecat
Copy link

@lechatthecat lechatthecat commented Oct 22, 2019

I'm using Ubuntu and the error message says:

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

So I installed it:

sudo apt install libssl-dev

And it is working now.

lovasoa added a commit to lovasoa/dezoomify-rs that referenced this issue Mar 19, 2020
@NoCtrlZ
Copy link

@NoCtrlZ NoCtrlZ commented Mar 29, 2020

I fix this problem to add.

Cargo.toml

[dependencies]
openssl = { version = "0.10", features = ["vendored"] }

@LeonidKrutovsky
Copy link

@LeonidKrutovsky LeonidKrutovsky commented Apr 21, 2020

That's what helped me (on several ubuntu systems)

sudo apt install openssl1.0 libssl1.0.0 libssl1.0-dev
cargo clean
OPENSSL_LIB_DIR="/usr/lib/x86_64-linux-gnu" 
OPENSSL_INCLUDE_DIR="/usr/include/openssl" 
cargo build

@singularidadedigital
Copy link

@singularidadedigital singularidadedigital commented Aug 17, 2020

I'm using Ubuntu and the error message says:

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

So I installed it:

sudo apt install libssl-dev

And it is working now.

works for me, thanks

@thanhngvpt
Copy link

@thanhngvpt thanhngvpt commented Nov 12, 2020

I'm using Ubuntu and the error message says:

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

So I installed it:

sudo apt install libssl-dev

And it is working now.

Works for me, thanks

@mybee
Copy link

@mybee mybee commented May 15, 2021

thanks, sudo apt install libssl-dev and sudo apt install pkg-config

@LeoniePhiline
Copy link

@LeoniePhiline LeoniePhiline commented Aug 15, 2021

For Googlers:

On OpenSUSE (e.g. Tumbleweed) run sudo zypper install libopenssl-devel

@pablobendiksen
Copy link

@pablobendiksen pablobendiksen commented Oct 23, 2021

I fix this problem to add.

Cargo.toml

[dependencies]
openssl = { version = "0.10", features = ["vendored"] }

Thank you so much!!! After literal hours of struggling, with no prior solution helping me (building a rust project within amazon linux) yours did the trick!

@riteshkumargiitian
Copy link

@riteshkumargiitian riteshkumargiitian commented Oct 29, 2021

encountering the same issue.. Does anyone know how to fix the same issue for the "windows " OS ? even if it is some development file then what is command for that please?

@Borregopornz
Copy link

@Borregopornz Borregopornz commented Dec 17, 2021

HELP

PS C:\Users\alan1\dougs-bin-example> cargo install cyberdrop-dl
Updating crates.io index
Installing cyberdrop-dl v0.3.2
Compiling proc-macro2 v1.0.34
Compiling unicode-xid v0.2.2
Compiling syn v1.0.82
Compiling winapi v0.3.9
Compiling cfg-if v1.0.0
Compiling autocfg v1.0.1
Compiling getrandom v0.1.16
Compiling proc-macro-hack v0.5.19
Compiling ppv-lite86 v0.2.15
Compiling log v0.4.14
Compiling siphasher v0.3.7
Compiling lazy_static v1.4.0
Compiling libc v0.2.112
Compiling memchr v2.4.1
Compiling pin-project-lite v0.2.7
Compiling futures-core v0.3.17
Compiling ntapi v0.3.6
Compiling itoa v0.4.8
Compiling futures-task v0.3.17
Compiling proc-macro-nested v0.1.7
Compiling serde v1.0.132
Compiling futures-sink v0.3.17
Compiling bytes v1.1.0
Compiling futures-channel v0.3.17
Compiling smallvec v1.7.0
Compiling matches v0.1.9
Compiling futures-io v0.3.17
Compiling parking_lot_core v0.8.5
Compiling slab v0.4.5
Compiling pin-utils v0.1.0
Compiling scopeguard v1.1.0
Compiling fnv v1.0.7
Compiling cc v1.0.72
Compiling new_debug_unreachable v1.0.4
Compiling hashbrown v0.11.2
Compiling pkg-config v0.3.24
Compiling mac v0.1.1
Compiling native-tls v0.2.8
Compiling vcpkg v0.2.15
Compiling tinyvec_macros v0.1.0
Compiling httparse v1.5.1
Compiling precomputed-hash v0.1.1
Compiling percent-encoding v2.1.0
Compiling utf-8 v0.7.6
Compiling try-lock v0.2.3
Compiling dtoa v0.4.8
Compiling nodrop v0.1.14
Compiling stable_deref_trait v1.2.0
Compiling encoding_rs v0.8.30
Compiling serde_json v1.0.73
Compiling bitflags v1.3.2
Compiling tower-service v0.3.1
Compiling httpdate v1.0.2
Compiling ryu v1.0.9
Compiling once_cell v1.9.0
Compiling unicode-bidi v0.3.7
Compiling convert_case v0.4.0
Compiling byteorder v1.4.3
Compiling unicode-width v0.1.9
Compiling openssl v0.10.38
Compiling foreign-types-shared v0.1.1
Compiling itoa v1.0.1
Compiling regex-syntax v0.6.25
Compiling thin-slice v0.1.1
Compiling encode_unicode v0.3.6
Compiling base64 v0.13.0
Compiling utf8-width v0.1.5
Compiling number_prefix v0.4.0
Compiling ipnet v2.3.1
Compiling mime v0.3.16
Compiling ego-tree v0.6.2
Compiling instant v0.1.12
Compiling futures-macro v0.3.17
Compiling futures-util v0.3.17
Compiling indexmap v1.7.0
Compiling phf_shared v0.8.0
Compiling tracing-core v0.1.21
Compiling lock_api v0.4.5
Compiling http v0.2.5
Compiling openssl-src v111.17.0+1.1.1m
Compiling futf v0.1.4
Compiling tinyvec v1.5.1
Compiling form_urlencoded v1.0.1
Compiling dtoa-short v0.3.3
Compiling servo_arc v0.1.1
Compiling fxhash v0.2.1
Compiling getopts v0.2.21
Compiling foreign-types v0.3.2
Compiling byte-unit v4.0.13
Compiling regex v1.5.4
Compiling tracing v0.1.29
Compiling openssl-sys v0.9.72
Compiling tendril v0.4.2
Compiling http-body v0.4.4
Compiling unicode-normalization v0.1.19
Compiling quote v1.0.10
Compiling rand_core v0.5.1
Compiling want v0.3.0
Compiling num_cpus v1.13.0
Compiling miow v0.3.7
Compiling schannel v0.1.19
Compiling socket2 v0.4.2
Compiling terminal_size v0.1.17
Compiling winreg v0.7.0
Compiling idna v0.2.3
Compiling rand_pcg v0.2.1
Compiling rand_chacha v0.2.2
Compiling serde_urlencoded v0.7.0
Compiling parking_lot v0.11.2
Compiling mio v0.7.14
Compiling console v0.15.0
Compiling url v2.2.2
error: failed to run custom build command for openssl-sys v0.9.72

Caused by:
process didn't exit successfully: C:\Users\alan1\AppData\Local\Temp\cargo-installUz4j3n\release\build\openssl-sys-d021080d1b2a556d\build-script-main (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR
X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR unset
cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
OPENSSL_NO_VENDOR unset
running "perl" "./Configure" "--prefix=C:\Users\alan1\AppData\Local\Temp\cargo-installUz4j3n\release\build\openssl-sys-294c4342b0e8354b\out\openssl-build\install" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ci
--- stderr
pecified." }', C:\Users\alan1.cargo\registry\src\github.com-1ecc6299db9ec823\openssl-src-111.17.0+1.1.1m\src\lib.rs:477:39
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 cyberdrop-dl v0.3.2, intermediate artifacts can be found at C:\Users\alan1\AppData\Local\Temp\cargo-installUz4j3n

Caused by:
build failed

@Borregopornz
Copy link

@Borregopornz Borregopornz commented Dec 17, 2021

Im on windows btw );;;

@lowkeyop
Copy link

@lowkeyop lowkeyop commented Dec 17, 2021

@QuillChain
Copy link

@QuillChain QuillChain commented Dec 17, 2021

I'm using Ubuntu and the error message says:

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

So I installed it:

sudo apt install libssl-dev

And it is working now.

It's working

@lowkeyop
Copy link

@lowkeyop lowkeyop commented Dec 17, 2021

@z16166
Copy link

@z16166 z16166 commented Dec 21, 2021

Im on windows btw );;;

install Perl first.

@riteshkumargiitian
Copy link

@riteshkumargiitian riteshkumargiitian commented Jan 3, 2022

Im on windows btw );;;

For windows users :)
(1). what worked for me was installing "openssl" package with choco:

choco install openssl

(2). then set its path to the variable:

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

hope that works for you too ...

@rezazarchi
Copy link

@rezazarchi rezazarchi commented Mar 7, 2022

That's what helped me (on several ubuntu systems)

sudo apt install openssl1.0 libssl1.0.0 libssl1.0-dev
cargo clean
OPENSSL_LIB_DIR="/usr/lib/x86_64-linux-gnu" 
OPENSSL_INCLUDE_DIR="/usr/include/openssl" 
cargo build

It won't install on Ubuntu 20.04. It shows error that couldn't find them.

@surphury
Copy link

@surphury surphury commented Apr 3, 2022

I'm using Ubuntu and the error message says:

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

So I installed it:

sudo apt install libssl-dev

And it is working now.

works for me, thanks

it has worked for me as well on Linux mint... Thank you!

@WarSame
Copy link

@WarSame WarSame commented Apr 8, 2022

I was missing Make. I installed it on Ubuntu using sudo apt-get install build-essential

@uwatr
Copy link

@uwatr uwatr commented Apr 20, 2022

I'm using Ubuntu and the error message says:

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

So I installed it:

sudo apt install libssl-dev

And it is working now.

This worked for me on Debian 11... thanks!

@TheWeirdDev
Copy link

@TheWeirdDev TheWeirdDev commented Apr 25, 2022

I had to install librust-openssl-dev on Ubuntu Server 20.04:

sudo apt install librust-openssl-dev

@HsiangSun
Copy link

@HsiangSun HsiangSun commented May 4, 2022

我正在使用Ubuntu,错误消息说:

Make sure you also have the development packages of openssl installed.
For example, libssl-dev on Ubuntu or openssl-devel on Fedora.

所以我安装了它:

sudo apt install libssl-dev

它现在正在发挥作用。

Nice it's work on ubuntu 20.04 WSL

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