moriturus / ktra

Your Little Cargo Registry

Home Page:https://book.ktra.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cargo build fails

gl-yziquel opened this issue · comments

Just tried to compile ktra with cargo build on tag 0.7.0. Got the following log.

This is an ubuntu system. Linux 6.2.0-1010-nvidia #10-Ubuntu SMP PREEMPT_DYNAMIC x86_64 GNU/Linux

cargo tree tells me that my ssl dependency pulled by cargo is openssl-sys v0.9.90. git2 pulls version v0.9.90 and reqwest pulls version v0.10.55. This gets reconciled to version v0.9.90.

  = note: /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibgit2_sys-b724feea96647aca.rlib(openssl.o): in function `openssl_init':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libgit2-sys-0.12.26+1.3.0/libgit2/src/streams/openssl.c:145: undefined reference to `SSL_CTX_ctrl'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibgit2_sys-b724feea96647aca.rlib(openssl.o): in function `verify_server_cert':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libgit2-sys-0.12.26+1.3.0/libgit2/src/streams/openssl.c:401: undefined reference to `SSL_get1_peer_certificate'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibgit2_sys-b724feea96647aca.rlib(openssl.o): in function `openssl_connect':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libgit2-sys-0.12.26+1.3.0/libgit2/src/streams/openssl.c:531: undefined reference to `SSL_ctrl'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibgit2_sys-b724feea96647aca.rlib(openssl.o): in function `openssl_certificate':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libgit2-sys-0.12.26+1.3.0/libgit2/src/streams/openssl.c:545: undefined reference to `SSL_get1_peer_certificate'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibssh2_sys-2a9b7891975d8646.rlib(openssl.o): in function `_libssh2_ed25519_new_private_frommemory':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libssh2-sys-0.2.23/libssh2/src/openssl.c:1835: undefined reference to `EVP_PKEY_get_id'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibssh2_sys-2a9b7891975d8646.rlib(openssl.o): in function `_libssh2_pub_priv_keyfile':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libssh2-sys-0.2.23/libssh2/src/openssl.c:3001: undefined reference to `EVP_PKEY_get_id'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibssh2_sys-2a9b7891975d8646.rlib(openssl.o): in function `_libssh2_pub_priv_keyfilememory':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libssh2-sys-0.2.23/libssh2/src/openssl.c:3211: undefined reference to `EVP_PKEY_get_id'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibssh2_sys-2a9b7891975d8646.rlib(mac.o): in function `mac_method_hmac_ripemd160_hash':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libssh2-sys-0.2.23/libssh2/src/mac.c:354: undefined reference to `EVP_ripemd160'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibssh2_sys-2a9b7891975d8646.rlib(crypt.o):(.data.rel.ro.libssh2_crypt_method_blowfish_cbc+0x40): undefined reference to `EVP_bf_cbc'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/liblibssh2_sys-2a9b7891975d8646.rlib(crypt.o):(.data.rel.ro.libssh2_crypt_method_cast128_cbc+0x40): undefined reference to `EVP_cast5_cbc'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/libopenssl-cb21597defe4182a.rlib(openssl-cb21597defe4182a.openssl.f5acc07b9d67cffb-cgu.07.rcgu.o): in function `openssl::error::Error::get':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-0.10.55/src/error.rs:122: undefined reference to `ERR_get_error_all'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/libopenssl_sys-0d6d27204dddf829.rlib(openssl_sys-0d6d27204dddf829.openssl_sys.547b75131ddb7575-cgu.0.rcgu.o): in function `openssl_sys::openssl::ssl::SSL_CTX_set_mode':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/src/./ssl.rs:246: undefined reference to `SSL_CTX_ctrl'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/libopenssl_sys-0d6d27204dddf829.rlib(openssl_sys-0d6d27204dddf829.openssl_sys.547b75131ddb7575-cgu.0.rcgu.o): in function `openssl_sys::openssl::ssl::SSL_CTX_add_extra_chain_cert':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/src/./ssl.rs:380: undefined reference to `SSL_CTX_ctrl'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/libopenssl_sys-0d6d27204dddf829.rlib(openssl_sys-0d6d27204dddf829.openssl_sys.547b75131ddb7575-cgu.0.rcgu.o): in function `openssl_sys::openssl::tls1::SSL_set_tlsext_host_name':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/src/./tls1.rs:24: undefined reference to `SSL_ctrl'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/libopenssl_sys-0d6d27204dddf829.rlib(openssl_sys-0d6d27204dddf829.openssl_sys.547b75131ddb7575-cgu.0.rcgu.o): in function `openssl_sys::openssl::ssl::SSL_CTX_set_min_proto_version':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/src/./ssl.rs:455: undefined reference to `SSL_CTX_ctrl'
          /usr/bin/ld: /home/yziquel/home/cellar/ktra/target/debug/deps/libopenssl_sys-0d6d27204dddf829.rlib(openssl_sys-0d6d27204dddf829.openssl_sys.547b75131ddb7575-cgu.0.rcgu.o): in function `openssl_sys::openssl::ssl::SSL_CTX_set_max_proto_version':
          /home/yziquel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-sys-0.9.90/src/./ssl.rs:464: undefined reference to `SSL_CTX_ctrl'
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

warning: `ktra` (bin "ktra") generated 1 warning
error: could not compile `ktra` (bin "ktra") due to previous error; 1 warning emitted

Compiles on my machine with this PR:

#69

It vendors openssl.

For convenience, see repo here: https://github.com/gl-yziquel/ktra