Background
In Rust, one can build and target one of four profiles.
The available profiles are dev, release, test, and bench.
Cargo
We will use Rust’s Cargo tool to build.
Commands
- clean
- build
- target
- dev
- release
- test
- bench
- target
Clean
Outline
Removes previously built artifacts.
Syntax
cargo clean
Sample
cargo clean
Build
Syntax
cargo build
Sample – Development
cargo build -- profile dev
Output
Image
Textual
>cargo build --profile dev Compiling kjvonly v0.1.0 (R:\spirituality\christianity\scripture\bible\KJVOnly) Finished dev [unoptimized + debuginfo] target(s) in 0.60s >
Sample – Release
cargo build -- profile release
Output
Image
Textual
>cargo build --profile release Compiling kjvonly v0.1.0 (R:\spirituality\christianity\scripture\bible\KJVOnly) Finished release [optimized] target(s) in 0.56s >
Artifacts
Outline
- Artifacts
- List
List
Dir
Syntax
dir
Sample
List executable files ( *.exe) from the target\debug and target\release folders.
dir /A-D target\debug\*.exe target\release\*.exe
Output
Image
Text
>dir /A-D target\debug\*.exe target\release\*.exe Directory of R:\spirituality\christianity\scripture\bible\KJVOnly\target\debug 04/17/2023 01:45 PM 198,656 kjvonly.exe 1 File(s) 198,656 bytes Directory of R:\spirituality\christianity\scripture\bible\KJVOnly\target\release 04/17/2023 01:52 PM 167,936 kjvonly.exe 1 File(s) 167,936 bytes 0 Dir(s) 602,755,371,008 bytes free >