Section: Components and targets

Build for a specific target

bash
bash
cargo build --target x86_64-unknown-linux-musl
Explanation

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
Install a target triple
Add support for a cross-compilation target.
OpenIn sheetbashsame section
List installed and available components
See whether rustfmt, clippy, or docs are installed.
OpenIn sheetbashsame section
Install Clippy
Add the Clippy lint component to the active toolchain.
OpenIn sheetbashsame section
Install rustfmt
Add the formatter component to the active toolchain.
OpenIn sheetbashsame section
List installed targets
Show available target triples already added locally.
OpenIn sheetbashsame section
Run Cargo with a specific toolchain
Use a channel explicitly for one command.
OpenIn sheetbash1 tag match