commands.sh

cargo build

all

Compile a local package and all of its dependencies.

More info →

Options (3)

boolean

Build the package or packages defined by the `Cargo.toml` manifest file in the local path

Example: cargo {{[b|build]}}
-r, --releaseboolean

Build artifacts in release mode, with optimizations

Example: cargo {{[b|build]}} {{[-r|--release]}}
-p, --packageboolean

Build a specific package

Example: cargo {{[b|build]}} {{[-p|--package]}} {{package}}

Examples (7)

Build the package or packages defined by the `Cargo.toml` manifest file in the local path

cargo [b|build]

Build artifacts in release mode, with optimizations

cargo [b|build] [-r|--release]

Require that `Cargo.lock` is up to date

cargo [b|build] --locked

Build all packages in the workspace

cargo [b|build] --workspace

Build a specific package

cargo [b|build] [-p|--package] package

Build only the specified binary

cargo [b|build] --bin name

Build only the specified test target

cargo [b|build] --test test_name
made by @shridhargupta | data from tldr-pages