LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

cargo-build

Compile a Rust package and its dependencies

TLDR

Build project
$ cargo build
copy
Build with release optimizations
$ cargo build --release
copy
Build specific package
$ cargo build -p [package]
copy
Build all workspace members
$ cargo build --workspace
copy
Build with specific features
$ cargo build --features [feature1,feature2]
copy
Build all features
$ cargo build --all-features
copy
Build for specific target
$ cargo build --target [x86_64-unknown-linux-gnu]
copy
Build offline
$ cargo build --offline
copy

SYNOPSIS

cargo build [options]

DESCRIPTION

cargo build compiles a local package and all its dependencies. Creates executable in target/debug/ by default, or target/release/ with --release flag.Debug builds compile faster but run slower. Release builds are optimized but take longer to compile.

PARAMETERS

-r, --release

Build with optimizations (release profile)
--profile name
Build with specific profile
-p, --package spec
Build only specified packages
--workspace
Build all workspace members
--all-targets
Build all targets (lib, bins, tests, benches, examples)
--lib
Build library only
--bins
Build all binaries
--examples
Build all examples
--target triple
Build for target platform
--target-dir dir
Output directory
-j, --jobs n
Parallel build jobs
--features features
Enable specified features
--all-features
Enable all features
--no-default-features
Disable default features
--offline
Build without network access
--timings
Output build timing info

OUTPUT LOCATIONS

target/debug/

Debug builds (default)
target/release/
Release builds (--release)

INSTALL

sudo apt install cargo
copy
sudo dnf install cargo
copy
sudo apk add cargo
copy
sudo zypper install cargo
copy
nix profile install nixpkgs#cargo
copy

CAVEATS

Same commands work across all operating systems. First build downloads and compiles dependencies.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid