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

[Bug]: cargo shuttle run(openssl-sys) does not detect the correct path for the cargo executable #1103

Closed
1 task done
YoungHaKim7 opened this issue Jul 22, 2023 · 5 comments
Labels
T-Bug Something isn't working

Comments

@YoungHaKim7
Copy link

YoungHaKim7 commented Jul 22, 2023

What happened?

A bug happened!

 $ RUST_BACKTRACE=full cargo shuttle run                                                                                        

    Building /root/my-project/rustshttle1
   Compiling openssl-sys v0.9.90
   Compiling opentelemetry-otlp v0.12.0
error: failed to run custom build command for `openssl-sys v0.9.90`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/root/my-project/rustshttle1/target/debug/build/openssl-sys-a55d9fff2f9c1f76/build-script-main` (exit status: 101)
  --- stdout
  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_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "openssl"` did not exit successfully: exit status: 1
  error: could not find system library 'openssl' required by the 'openssl-sys' crate

  --- stderr
  Package openssl was not found in the pkg-config search path.
  Perhaps you should add the directory containing `openssl.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'openssl', required by 'virtual:world', not found


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

  ', /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/build/find_normal.rs:190:5
  stack backtrace:
     0:     0x5579f0f5f9a1 - std::backtrace_rs::backtrace::libunwind::trace::h6aeaf83abc038fe6
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
     1:     0x5579f0f5f9a1 - std::backtrace_rs::backtrace::trace_unsynchronized::h4f9875212db0ad97
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:     0x5579f0f5f9a1 - std::sys_common::backtrace::_print_fmt::h3f820027e9c39d3b
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:65:5
     3:     0x5579f0f5f9a1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hded4932df41373b3
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:44:22
     4:     0x5579f0f835ff - core::fmt::rt::Argument::fmt::hc8ead7746b2406d6
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/fmt/rt.rs:138:9
     5:     0x5579f0f835ff - core::fmt::write::hb1cb56105a082ad9
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/fmt/mod.rs:1094:21
     6:     0x5579f0f5c4e1 - std::io::Write::write_fmt::h797fda7085c97e57
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/io/mod.rs:1713:15
     7:     0x5579f0f5f7b5 - std::sys_common::backtrace::_print::h492d3c92d7400346
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:47:5
     8:     0x5579f0f5f7b5 - std::sys_common::backtrace::print::hf74aa2eef05af215
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:34:9
     9:     0x5579f0f61527 - std::panicking::default_hook::{{closure}}::h8cad394227ea3de8
    10:     0x5579f0f61314 - std::panicking::default_hook::h249cc184fec99a8a
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:288:9
    11:     0x5579f0f619dc - std::panicking::rust_panic_with_hook::h82ebcd5d5ed2fad4
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:705:13
    12:     0x5579f0f618d7 - std::panicking::begin_panic_handler::{{closure}}::h810bed8ecbe66f1a
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:597:13
    13:     0x5579f0f5fdd6 - std::sys_common::backtrace::__rust_end_short_backtrace::h1410008071796261
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:151:18
    14:     0x5579f0f61622 - rust_begin_unwind
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
    15:     0x5579f0eb29d3 - core::panicking::panic_fmt::ha0a42a25e0cf258d
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:67:14
    16:     0x5579f0eba345 - core::panicking::panic_display::h001779ba9f63e53c
    17:     0x5579f0ebc15c - build_script_main::find_normal::find_openssl_dir::h2f15c48fdcf6d3b8
    18:     0x5579f0ebac72 - build_script_main::find_normal::get_openssl::{{closure}}::ha080f3c0bc939635
    19:     0x5579f0ebf059 - core::option::Option<T>::unwrap_or_else::h323d9af64fa9326f
    20:     0x5579f0eba896 - build_script_main::find_normal::get_openssl::h677ae7e8a4134b71
    21:     0x5579f0eb4aed - build_script_main::find_openssl::h161cb9811fafeeba
    22:     0x5579f0eb4c51 - build_script_main::main::h4474c8581d445509
    23:     0x5579f0ebe943 - core::ops::function::FnOnce::call_once::h7e2a8ac70b0f8de0
    24:     0x5579f0ebe786 - std::sys_common::backtrace::__rust_begin_short_backtrace::hc43be10f415d791e
    25:     0x5579f0eb8849 - std::rt::lang_start::{{closure}}::h916de0b9e212dfcb
    26:     0x5579f0f57ea5 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h5ce27e764c284c0a
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/ops/function.rs:284:13
    27:     0x5579f0f57ea5 - std::panicking::try::do_call::h4c1fc390ae241991
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:500:40
    28:     0x5579f0f57ea5 - std::panicking::try::h4d36e7eaed86af72
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:464:19
    29:     0x5579f0f57ea5 - std::panic::catch_unwind::h41cfb4dd65282b1e
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panic.rs:142:14
    30:     0x5579f0f57ea5 - std::rt::lang_start_internal::{{closure}}::hfed411c1c5fdb925
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/rt.rs:148:48
    31:     0x5579f0f57ea5 - std::panicking::try::do_call::h6893f6f32a464342
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:500:40
    32:     0x5579f0f57ea5 - std::panicking::try::h52b7102f469a0567
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:464:19
    33:     0x5579f0f57ea5 - std::panic::catch_unwind::h62120054677916b5
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panic.rs:142:14
    34:     0x5579f0f57ea5 - std::rt::lang_start_internal::hd66bf6b7da144005
                                 at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/rt.rs:148:20
    35:     0x5579f0eb8827 - std::rt::lang_start::hf99ee351974659e6
    36:     0x5579f0eb8745 - main
    37:     0x7fb24603feb0 - __libc_start_call_main
    38:     0x7fb24603ff60 - __libc_start_main_impl
    39:     0x5579f0eb3165 - _start
    40:                0x0 - <unknown>
warning: build failed, waiting for other jobs to finish...
Error: Build failed. Is the Shuttle runtime missing?

 $ which openssl                                                                                                               
/usr/bin/openssl
 
$ rustc --version --verbose                                                                                          
rustc 1.71.0 (8ede3aae2 2023-07-12)
binary: rustc
commit-hash: 8ede3aae28fe6e4d52b38157d7bfe0d3bceef225
commit-date: 2023-07-12
host: x86_64-unknown-linux-gnu
release: 1.71.0
LLVM version: 16.0.5

Version

v0.21.0

Which operating system(s) are you seeing the problem on?

Linux

Which CPU architectures are you seeing the problem on?

x86_64

Relevant log output

I installed openssl in a Linux(Rocky 9) environment, but I got an error saying I couldn't find it, so I don't know what to do.

I installed something else because it didn't install at first.(""" cargo install cargo-shuttle"""The same error message came out when installing with this command, but it was forced to install with the command below.)

cargo install cargo-shuttle --features vendored-openssl

#720

Duplicate declaration

  • I have searched the issues and there are none like this.
@YoungHaKim7 YoungHaKim7 added the T-Bug Something isn't working label Jul 22, 2023
@YoungHaKim7 YoungHaKim7 changed the title [Bug]: [Bug]: cargo shuttle run(openssl-sys) does not detect the correct path for the cargo executable Jul 22, 2023
@AlphaKeks
Copy link
Contributor

You need to install openssl-devel. OpenSSL is split up into a library (openssl-devel) which can then be used to implement multiple "frontends". One of those frontends is openssl. The openssl-sys crate however requires the C library so it can link to it.

@YoungHaKim7
Copy link
Author

Compiling linux-raw-sys v0.3.8
   Compiling urlencoding v2.1.3
error: failed to run custom build command for `openssl-sys v0.9.90`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installFBEHVt/release/build/openssl-sys-292da93e5d4049c0/build-script-main` (exit status: 101)
  --- stdout
  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_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "openssl"` did not exit successfully: exit status: 1
  error: could not find system library 'openssl' required by the 'openssl-sys' crate

  --- stderr
  Package openssl was not found in the pkg-config search path.
  Perhaps you should add the directory containing `openssl.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'openssl' found


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

  ', /home/gy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/build/find_normal.rs:190:5
  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-shuttle v0.21.0`, intermediate artifacts can be found at `/tmp/cargo-installFBEHVt`


❯ cat /etc/os-release                                                                                                          ─╯
NAME="Linux Mint"
VERSION="21.2 (Victoria)"
ID=linuxmint
ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 21.2"
VERSION_ID="21.2"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=victoria
UBUNTU_CODENAME=jammy


❯ sudo apt install openssl-devel                                                                                               ─╯
[sudo] password for gy:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openssl-devel


❯ sudo apt install openssl                                                                                                     ─╯
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openssl is already the newest version (3.0.2-0ubuntu1.10).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

@YoungHaKim7
Copy link
Author

thank you .
I owe it to you.

sudo apt-get install libssl-dev

https://stackoverflow.com/questions/3016956/how-do-i-install-the-openssl-libraries-on-ubuntu

@AlphaKeks
Copy link
Contributor

I thought you were on Rocky Linux? Either way, if this is resolved, feel free to close the issue :) If you still have questions, feel free to ask them.

@YoungHaKim7
Copy link
Author

cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.2 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.2"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.2 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.2"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2"
sudo yum groupinstall 'Development Tools' 
cargo install cargo-shuttle 

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants