egg-mode-rs/egg-mode

Building with 'hyper-rustls' feature and without 'native-tls' still requires openssl-sys crate.

prixt opened this issue · 3 comments

prixt commented

I'm trying to cross-compile an application from Windows to the Pi(armv7-unknown-linux-gnueabihf).
It seems egg_mode still uses the openssl-sys crate, and therefore requires linking to OpenSSL binaries/libs.

In Cargo.toml:
egg_mode={version="0.13.0", default-features=false, features=["hyper-rustls"]}

Command:
cargo build --release --target=armv7-unknown-linux-gnueabihf

Result:

error: failed to run custom build command for `openssl-sys v0.9.49`                                                        

Caused by:
  process didn't exit successfully: `D:\MyProjects\Rust\twitter_bot01\target\release\build\openssl-sys-a844bd1d65ed445b\build-script-main` (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_LIB_DIR
ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_INCLUDE_DIR
ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_DIR
ARMV7_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
run pkg_config fail: "Cross compilation detected. Use PKG_CONFIG_ALLOW_CROSS=1 to override"
note: vcpkg did not find openssl as libcrypto and libssl: the vcpkg-rs Vcpkg build helper can only find libraries built for the MSVC ABI.
note: vcpkg did not find openssl as ssleay32 and libeay32: the vcpkg-rs Vcpkg build helper can only find libraries built for the MSVC ABI.

--- 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-pc-windows-msvc
$TARGET = armv7-unknown-linux-gnueabihf
openssl-sys = 0.9.49

', C:\Users\pc\.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.
prixt commented

It seems this is a problem when you get 'egg-mode' using crates.io & cargo. After I cloned this repository and built this crate locally with the same features, it builds just fine...

# egg-mode = {version="0.13.0", default-features=false, features=[ "hyper-rustls" ]} # This doens't work.
egg-mode = {path="twitter-rs", default-features=false, features=[ "hyper-rustls" ]} # But this does?

Where is the problem here?

I don't think there is a 'problem' as such. The bug you hit has been fixed in master but not yet released. You can use master until the next release is ready.

prixt commented

Didn't know master was newer than the cargo version. Cargo.toml version was the same. Closing this issue then.