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

Cross Compiling - Not work for MUSL #66

Closed
whizsid opened this issue May 16, 2020 · 1 comment
Closed

Cross Compiling - Not work for MUSL #66

whizsid opened this issue May 16, 2020 · 1 comment

Comments

@whizsid
Copy link

whizsid commented May 16, 2020

I have compiled a simple rust program with hyper-tls crate. But it is not working. Without hyper-tls it is working.

Steps to reproduce

  1. Create a project with below dependencies
# Cargo.toml
[package]
name = "musltest"
version = "0.1.0"
edition = "2018"

[dependencies]
hyper = "0.13.2"
hyper-tls = "0.4.1"
// main.rs
use hyper::Client;
use hyper_tls::HttpsConnector;

fn main (){

    let https = HttpsConnector::new();
    let client = Client::builder().build::<_, hyper::Body>(https);
    println!("Hello world!")
}
  1. Run below commands
[whizsid@archlinux musltest]$ export OPENSSL_INCLUDE_DIR=/usr/include/openssl-1.0
[whizsid@archlinux musltest]$ export OPENSSL_LIB_DIR=/usr/lib/openssl-1.0
[whizsid@archlinux musltest]$ export OPENSSL_DIR=/etc/ssl
[whizsid@archlinux musltest]$ cargo build --target x86_64-unknown-linux-musl
warning: unused variable: `client`
 --> src/main.rs:7:9
  |
7 |     let client = Client::builder().build::<_, hyper::Body>(https);
  |         ^^^^^^ help: consider prefixing with an underscore: `_client`
  |
  = note: `#[warn(unused_variables)]` on by default
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
[whizsid@archlinux musltest]$ docker run -itd --rm -v $PWD:/data --name=musltest alpine
e60df22d416c085eb5d491bc8de6256651958d24d50752caafadf5e484f22ba6
[whizsid@archlinux musltest]$ docker exec -it musltest /data/target/x86_64-unknown-linux-musl/debug/musltest
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "no such file or directory": unknown

Is this an error of rust-openssl?

@whizsid
Copy link
Author

whizsid commented May 16, 2020

Sorry I have fixed it using the method in this comment

@whizsid whizsid closed this as completed May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant