Compile artifacts for a non-default platform.
Section: Targets and cross-compilation
Build for a target triple
bash
bash
cargo build --target x86_64-unknown-linux-muslExplanation
Target-specific artifacts are stored under `target/<triple>/...`.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Targets and cross-compilation
Run is typically host-only
Build target-specific binaries for packaging instead of running them locally.
Use stable once without changing defaults
Run one command on the stable toolchain.