From 151ef07fb307666cceca856c5d4c31dcbb43e3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Sun, 18 Oct 2020 08:48:31 +0200 Subject: [PATCH] docs: cross compile --- CROSS_COMPILE.md | 13 +++++++++++++ Cargo.lock | 10 ++++++++++ Cargo.toml | 1 + 3 files changed, 24 insertions(+) create mode 100644 CROSS_COMPILE.md diff --git a/CROSS_COMPILE.md b/CROSS_COMPILE.md new file mode 100644 index 00000000..3c7bbcb5 --- /dev/null +++ b/CROSS_COMPILE.md @@ -0,0 +1,13 @@ +Install docker: + +$ sudo apt install docker +$ sudo usermod -aG docker $USER + +Then log out and back in. + +$ sudo systemctl start docker + +$ cargo install cross +$ cross build --release --features tls_vendored --target armv7-unknown-linux-musleabihf + +The cross-compiled binary is at target/armv7-unknown-linux-musleabihf/release/conduit diff --git a/Cargo.lock b/Cargo.lock index a658ee2b..6fed2aff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1136,6 +1136,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.58" @@ -1145,6 +1154,7 @@ dependencies = [ "autocfg", "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 2126e427..acab8d07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,7 @@ trust-dns-resolver = "0.19.5" [features] default = ["conduit_bin"] conduit_bin = [] # TODO: add rocket to this when it is optional +tls_vendored = ["reqwest/native-tls-vendored"] [[bin]] name = "conduit"