Rust CLI Build, Run, Test, and Lint/Build one binary target

Compile a chosen binary only.

Section: Profiles and target selection

Build one binary target

bash
bash
cargo build --bin admin-tool
Explanation

Targets can be selected individually in multi-target packages.

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 Profiles and target selection
Build an example target
Compile only a chosen example.
OpenIn sheetbashsame section
Build tests without running them
Compile test artifacts only.
OpenIn sheetbashsame section
Check all package targets
Type-check binaries, tests, examples, and benches.
OpenIn sheetbashsame section
Build debug artifacts
Compile the package in the dev profile.
OpenIn sheetbash2 tag match
Build optimized release artifacts
Compile with the release profile.
OpenIn sheetbash2 tag match
Run a specific binary target
Choose which binary to execute in multi-bin packages.
OpenIn sheetbash2 tag match