Compile using an installed target triple.
Section: Components and targets
Build for a specific target
bash
bash
cargo build --target x86_64-unknown-linux-muslExplanation
Useful after adding the target with rustup and configuring any required linker or C toolchain pieces.
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 Components and targets
List installed and available components
See whether rustfmt, clippy, or docs are installed.
List installed targets
Show available target triples already added locally.
Run Cargo with a specific toolchain
Use a channel explicitly for one command.