Our great sponsors
“Zero setup” cross compilation and “cross testing” of Rust crates
I'm not sure who needs to see this, but I had been struggling with compile times using cross + Docker Desktop on Mac while working on a small personal project the past few days. Despite the whole project being fewer than 350 LOC between a few files, recompiling the project with any change was taking upwards of 2 minutes through cross. I went through the due diligence of reducing the number of dependencies, removing features and macros that I didn't need, not compiling in release mode, trying different file sharing implementations for Docker Desktop and with all of that combined the time dropped to around 1 minute and 30 seconds for an incremental build. Still far from ideal for a small personal project.
Compile Cargo project with zig as linker
Perhaps you can try cargo-zigbuild, it uses zig-cc for cross-compilation instead of creating a container, so it should be much more lightweight on MacOS, without all the cost of virtualization and file sharing.
Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.
A guide to cross-compilation in Rust
2 projects | dev.to | 1 Jun 2023
Is there a definitive guide on cross-compiling with OpenSSL?
2 projects | /r/rust | 26 May 2023
How to you develop in containers?
2 projects | /r/AskProgramming | 22 Apr 2023
How does cargo cross work?
2 projects | /r/rust | 22 Mar 2023
Rust cross-compilation without struggles by using the nixpkgs-cross-overlay
4 projects | /r/rust | 11 Mar 2023