TL;DR — Quick Summary
cross makes Rust cross-compilation easy. Compile for Linux ARM, Windows, macOS, WASM — using Docker containers with pre-configured toolchains. Drop-in cargo replacement.
cross compiles Rust for any target. Docker handles the toolchains — you just build.
Installation
cargo install cross --git https://github.com/cross-rs/cross
Usage
# Build for Linux ARM64
cross build --target aarch64-unknown-linux-gnu
# Build for Linux ARM (Raspberry Pi)
cross build --target armv7-unknown-linux-gnueabihf
# Release build for Windows
cross build --target x86_64-pc-windows-gnu --release
# Test on target
cross test --target aarch64-unknown-linux-gnu
Summary
- cross: drop-in cargo replacement for cross-compilation
- Docker-powered — pre-configured toolchains
- Supports 50+ target platforms
- Same workflow as cargo — just swap the command
- Written in Rust — maintained by cross-rs