Skip to content

Failed to run custom build command for openssl-sys v0.9.49 #456

Closed

Description

@jankoprowski

Ubuntu 18.04 LTS
libssl-dev 1.1.1

error: failed to compile nu v0.2.0, intermediate artifacts can be found at /tmp/cargo-installxwPzVk

Caused by:
  failed to run custom build command for openssl-sys v0.9.49

Caused by:
  process didn't exit successfully: /tmp/cargo-installxwPzVk/release/build/openssl-sys-35dfc077b34e63a5/build-script-main (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
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.49


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/johny/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.49/build/find_normal.rs:150:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

Any workarounds?

Activity

  1. sophiajt commented on Aug 26, 2019

    @sophiajt
    Contributor

    Not sure - but do you have pkgconfig installed as well? We've seen some issues related to that, I believe.

  2. jankoprowski commented on Aug 26, 2019

    @jankoprowski
    ContributorAuthor

    apt install pkg-config helped! Thanks a lot!

  3. sophiajt commented on Aug 27, 2019

    @sophiajt
    Contributor

    Sound good, closing. Will file an issue to add to README and book

  4. added a commit that references this issue on Feb 7, 2022
  5. added a commit that references this issue on Feb 7, 2022
  6. added a commit that references this issue on Jan 27, 2023
  7. added 2 commits that reference this issue on Apr 29, 2026
    f972c80
    f669627
  8. added 6 commits that reference this issue on May 4, 2026
    b9d3a27
    6983c91
    64ab31b
    50ddb0a
    39d28ef
    d98c008
  9. 150 remaining items

  10. added 15 commits that reference this issue on Nov 12, 2026
    f427d5e
    565fee2
    c8595d4
    a3dd8e6
    4695825
    4e0328f
    876912d
    492663f
    4e65e63
    5e8f309
    f2158cf
    16817a8
    d2071ef
    3dbf050
    798f9de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions