From c59918b080ea56c4311c1336ddaaf1325e8d5597 Mon Sep 17 00:00:00 2001 From: Kasper Date: Wed, 24 Mar 2021 17:58:34 +0100 Subject: [PATCH] Update cross-compile instructions to work for Rust 1.50 --- README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ca588e9..a580c6b 100644 --- a/README.md +++ b/README.md @@ -179,22 +179,23 @@ match string { - Angles - Flow rate -### Cross-compiling -For some reason `cross` stopped working for me in Rust 1.50 ([rust-lang/rust#83154](https://github.com/rust-lang/rust/issues/83154)). +### Cross-compiling (from x86_64 macOS) 1. [Install Docker](https://docs.docker.com/get-docker/) -2. Install [cross](https://github.com/rust-embedded/cross): +2. Install [`cross`](https://github.com/rust-embedded/cross). `cross` works by installing toolchains for whatever target you're building for, then using those toolchains to compile in Docker containers ``` cargo install cross ``` -3. Build for x86_64 macOS, Linux and Windows: - ```sh - cargo build --release --target x86_64-apple-darwin && cross build --release --target x86_64-unknown-linux-musl && cross build --release --target x86_64-pc-windows-gnu +3. Set rustup profile to minimal. This means things like `rustdoc` won't be included in new toolchain installations. You can run `rustup set profile default` to reset this afterwards. ``` - - Building for `x86_64-apple-darwin` only works on macOS - - For more targets, check out [the targets `cross` supports](https://github.com/rust-embedded/cross#supported-targets) - - If you run `cross build` in parallel, you might get a `cargo not found` error - -The compiled binaries will now be available inside `target//release/`. The filename will be either `cpc` or `cpc.exe`. + rustup set profile minimal + ``` +4. Build for x86_64 macOS, Linux and Windows. For more targets, check out [the targets `cross` supports](https://github.com/rust-embedded/cross#supported-targets) + ``` + cargo build --release --target x86_64-apple-darwin && + cross build --release --target x86_64-unknown-linux-musl && + cross build --release --target x86_64-pc-windows-gnu + ``` +5. The compiled binaries will now be available inside `target//release/`. The filename will be either `cpc` or `cpc.exe`. ### Releasing a new version