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-sys v0.9.72/ prost-build v0.10.4 #877

Closed
karolh2000 opened this issue Jul 19, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@karolh2000
Copy link
Member

Steps taken/Steps to reproduce

  1. clone the the repo (error: failed to run custom build command for openssl-sys v0.9.72)
  2. cd to the cloned repo
  3. run cargo build --workspace
  4. build fails with the following error
  Compiling serial_test_derive v0.8.0
   Compiling getset v0.1.2
   Compiling wasm-bindgen-macro-support v0.2.80
   Compiling zeroize_derive v1.3.2
   Compiling prost-build v0.10.4
   Compiling darling_macro v0.14.0
error: failed to run custom build command for `openssl-sys v0.9.72`

Caused by:
  process didn't exit successfully: `/home/user/trunk/pyrsia/target/debug/build/openssl-sys-e8353e4b38e637ff/build-script-main` (exit status: 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
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  run pkg_config fail: "`\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"` did not exit successfully: exit status: 1\nerror: could not find system library 'openssl' required by the 'openssl-sys' crate\n\n--- stderr\nPackage openssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `openssl.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'openssl' found\n"

  --- 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.72

  ', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.72/build/find_normal.rs:180:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Expected Behavior

cargo build --workspace shouldn't throw errors

Experienced Instance of the bug

Rust:
rustc 1.61.0 (fe5b13d68 2022-05-18)
cargo 1.61.0 (a028ae4 2022-04-29)

OS:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

Pyrsia
main (62b8562)

@karolh2000 karolh2000 added bug Something isn't working triage This is a new issue that needs to be reviewed at our Sprint Planning labels Jul 19, 2022
@tiainen
Copy link
Collaborator

tiainen commented Jul 20, 2022

You'll need to install libssl-dev, as mentioned in the error output:

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

This is also listed in our local dev setup guide: https://github.com/pyrsia/pyrsia/blob/main/docs/get_involved/local_dev_setup.md#installing-system-dependencies

@karolh2000
Copy link
Member Author

@tiainen I see another problem, this time related to "cmake" (prost-build), the logs shown below. However, I don't see "cmake" being mentioned in the installing-system-dependencies doc. I'll create a PR and add the mentioned dependencies to the doc (unless I am missing something and it's mentioned somewhere).

error: failed to run custom build command for `prost-build v0.10.4`

Caused by:
  process didn't exit successfully: `/home/user/trunk/pyrsia/target/debug/build/prost-build-131bfc147b2a643b/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "/home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.10.4/third-party/protobuf/cmake" "-Dprotobuf_BUILD_TESTS=OFF" "-DCMAKE_INSTALL_PREFIX=/home/user/trunk/pyrsia/target/debug/build/prost-build-bdc13d87fe4bf023/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"

  --- stderr
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

  build script failed, must exit now', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

@karolh2000 karolh2000 changed the title Error: failed to run custom build command for openssl-sys v0.9.72 Error: failed to run custom build command for openssl-sys v0.9.72/ prost-build v0.10.4 Jul 20, 2022
karolh2000 added a commit that referenced this issue Jul 20, 2022
…e "Error: failed to run custom build command for openssl-sys v0.9.72/ prost-build v0.10.4" (#877)

- Minor tutorial docs update.
@karolh2000
Copy link
Member Author

@tiainen The PR #882 contains minor suggestions to update the docs, the goal is to remove obstacles for a new user (based on my experience).

@karolh2000
Copy link
Member Author

As mentioned by @fishseabowl there is a PR that attempts to remove CMake from "prost", more info here: tokio-rs/prost#646 and here tokio-rs/prost#620 so no sure what we should do, wait until is fixed or just merge this one and wait until the prost library is closed.

@tiainen tiainen removed the triage This is a new issue that needs to be reviewed at our Sprint Planning label Jul 25, 2022
karolh2000 added a commit that referenced this issue Jul 25, 2022
#882)

- The missing info about required dependencies added, related to issue "Error: failed to run custom build command for openssl-sys v0.9.72/ prost-build v0.10.4" (#877)
- Minor tutorial docs update.
@karolh2000
Copy link
Member Author

The updated docs reflect required dependencies, eventually we might want to remove CMake when "prost" no longer depends on it but for now it stays.

Pyrsia Development automation moved this from MVP to Done Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants