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

Compilation error: failed to run custom build command for openssl-sys v0.9.85 #319

Closed
josecelano opened this issue May 2, 2023 · 1 comment · Fixed by #320
Closed

Compilation error: failed to run custom build command for openssl-sys v0.9.85 #319

josecelano opened this issue May 2, 2023 · 1 comment · Fixed by #320

Comments

@josecelano
Copy link
Member

I get an error compiling on a new machine with a newer Ubuntu version. We are using the "vendored" feature of the openssl crate.

If the vendored Cargo feature is enabled, the openssl-src crate will be used to compile and statically link to a copy of OpenSSL. The build process requires a C compiler, perl (and perl-core), and make. The OpenSSL version will generally track the newest OpenSSL release, and changes to the version are not considered breaking changes.

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

openssl = 0.10.50

Ubuntu:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.04
Release:	23.04
Codename:	lunar

Output:

   Compiling tokio v1.27.0
     Running `rustc --crate-name tokio --edition=2021 /home/josecelano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.27.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=190 --crate-type lib --emit=dep-info,metadata,link -C opt-level=1 -C linker-plugin-lto -C debuginfo=1 -C debug-assertions=on --cfg 'feature="bytes"' --cfg 'feature="default"' --cfg 'feature="fs"' --cfg 'feature="io-std"' --cfg 'feature="io-util"' --cfg 'feature="libc"' --cfg 'feature="macros"' --cfg 'feature="mio"' --cfg 'feature="net"' --cfg 'feature="num_cpus"' --cfg 'feature="rt"' --cfg 'feature="rt-multi-thread"' --cfg 'feature="signal"' --cfg 'feature="signal-hook-registry"' --cfg 'feature="socket2"' --cfg 'feature="sync"' --cfg 'feature="time"' --cfg 'feature="tokio-macros"' -C metadata=d6d0733dd48feaac -C extra-filename=-d6d0733dd48feaac --out-dir /home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps -L dependency=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps --extern bytes=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps/libbytes-a9d583d2ec6c7e6a.rmeta --extern libc=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps/liblibc-682f60176f42d8f7.rmeta --extern mio=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps/libmio-86ee1913bebc32f0.rmeta --extern num_cpus=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps/libnum_cpus-ea91fe9ba131a716.rmeta --extern pin_project_lite=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps/libpin_project_lite-8ff5352b5925d8c9.rmeta --extern signal_hook_registry=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps/libsignal_hook_registry-3217938f216e5c10.rmeta --extern socket2=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps/libsocket2-f85f8cded33141f6.rmeta --extern tokio_macros=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/deps/libtokio_macros-fc91118b674618e6.so --cap-lints allow`
error: failed to run custom build command for `openssl-sys v0.9.85`
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: `/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/build/openssl-sys-1ba70529ac9e8604/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_NO_VENDOR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
  CC_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
  CC_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
  CFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
  CFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  cargo:rerun-if-env-changed=AR_x86_64-unknown-linux-gnu
  AR_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=AR_x86_64_unknown_linux_gnu
  AR_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_AR
  HOST_AR = None
  cargo:rerun-if-env-changed=AR
  AR = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-linux-gnu
  ARFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_linux_gnu
  ARFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_ARFLAGS
  HOST_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  cargo:rerun-if-env-changed=RANLIB_x86_64-unknown-linux-gnu
  RANLIB_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=RANLIB_x86_64_unknown_linux_gnu
  RANLIB_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_RANLIB
  HOST_RANLIB = None
  cargo:rerun-if-env-changed=RANLIB
  RANLIB = None
  cargo:rerun-if-env-changed=RANLIBFLAGS_x86_64-unknown-linux-gnu
  RANLIBFLAGS_x86_64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=RANLIBFLAGS_x86_64_unknown_linux_gnu
  RANLIBFLAGS_x86_64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=HOST_RANLIBFLAGS
  HOST_RANLIBFLAGS = None
  cargo:rerun-if-env-changed=RANLIBFLAGS
  RANLIBFLAGS = None
  running cd "/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/build/openssl-sys-0e9b1a75d2e8c6ef/out/openssl-build/build/src" && AR="ar" CC="cc" RANLIB="ranlib" "perl" "./Configure" "--prefix=/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/build/openssl-sys-0e9b1a75d2e8c6ef/out/openssl-build/install" "--openssldir=/usr/local/ssl" "no-dso" "no-shared" "no-ssl3" "no-unit-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "linux-x86_64" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64"
  Configuring OpenSSL version 1.1.1t (0x1010114fL) for linux-x86_64
  Using os-specific seed configuration
  Creating configdata.pm
  Creating Makefile

  **********************************************************************
  ***                                                                ***
  ***   OpenSSL has been successfully configured                     ***
  ***                                                                ***
  ***   If you encounter a problem while building, please open an    ***
  ***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
  ***   and include the output from the following command:           ***
  ***                                                                ***
  ***       perl configdata.pm --dump                                ***
  ***                                                                ***
  ***   (If you are new to OpenSSL, you might want to consult the    ***
  ***   'Troubleshooting' section in the INSTALL file first)         ***
  ***                                                                ***
  **********************************************************************
  running cd "/home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/debug/build/openssl-sys-0e9b1a75d2e8c6ef/out/openssl-build/build/src" && "make" "depend"

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/josecelano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-src-111.25.2+1.1.1t/src/lib.rs:503:39
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/7f94b314cead7059a71a265a8b64905ef2511796/library/std/src/panicking.rs:584:5
     1: core::panicking::panic_fmt
               at /rustc/7f94b314cead7059a71a265a8b64905ef2511796/library/core/src/panicking.rs:67:14
     2: core::result::unwrap_failed
               at /rustc/7f94b314cead7059a71a265a8b64905ef2511796/library/core/src/result.rs:1651:5
     3: core::result::Result<T,E>::unwrap
     4: openssl_src::Build::run_command
     5: openssl_src::Build::build
     6: build_script_main::find_vendored::get_openssl
     7: build_script_main::find_openssl
     8: build_script_main::main
     9: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
josecelano added a commit to josecelano/torrust-tracker that referenced this issue May 2, 2023
@josecelano josecelano linked a pull request May 2, 2023 that will close this issue
josecelano added a commit to josecelano/torrust-tracker that referenced this issue May 2, 2023
@josecelano
Copy link
Member Author

I did not have the make package in the new machine. And it's required by the openssl crate. I have added that dependency to the docs.

josecelano added a commit that referenced this issue May 2, 2023
c65f039 docs: [#319] add system dependencies (Jose Celano)

Pull request description:

  Add system dependencies to docs.

Top commit has no ACKs.

Tree-SHA512: c0b2ded61a3638318d47ebd9c691bb8febc8364aabc51bdaee8511dbaf30b8cd2d503094f127f54563920c75ccddd44c7accd021f408083c7a8da812ef67948b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant