From e3a598fd578603573dfaa3e6229cb2616e20dfb6 Mon Sep 17 00:00:00 2001 From: Yong Wen Chua Date: Thu, 12 Nov 2020 11:28:20 +0800 Subject: [PATCH] Add vendored openssl crate to allow MUSL build --- Cargo.lock | 11 +++++++++++ Cargo.toml | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index ef13714..76d2440 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -937,6 +937,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +[[package]] +name = "openssl-src" +version = "111.12.0+1.1.1h" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "858a4132194f8570a7ee9eb8629e85b23cbc4565f2d4a162e87556e5956abf61" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.54" @@ -946,6 +955,7 @@ dependencies = [ "autocfg", "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -1810,6 +1820,7 @@ dependencies = [ "failure", "gcp_auth", "log", + "openssl-sys", "reqwest", "rusoto_core", "serde", diff --git a/Cargo.toml b/Cargo.toml index f95f461..23bc50c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,3 +21,14 @@ log = "0.4" url = "2.2" vault = { git = "https://github.com/lawliet89/vault-rs", package = "vault-rs", tag = "v0.2.0" } tokio = { version = "0.2", features=["macros", "rt-threaded"] } + +# Add openssl-sys as a direct dependency so it can be cross compiled to +# x86_64-unknown-linux-musl using the "vendored" feature below +# cf. https://github.com/sfackler/rust-openssl/issues/980#issuecomment-415757400 +openssl-sys = "*" + +[features] +# Force openssl-sys to staticly link in the openssl library. Necessary when +# cross compiling to x86_64-unknown-linux-musl. +# cf. https://github.com/sfackler/rust-openssl/issues/980#issuecomment-415757400 +vendored = ["openssl-sys/vendored"]