Cargo

The Rust package manager — manage dependencies, compile projects, run tests, and publish crates.

Category: pkg-mgmtFirst released: 2014Created by: Yehuda Katz, Carl Lerche (Rust Project)License: MIT/Apache-2.0Platforms: Linux, macOS, Windows

Cargo is the official package manager and build system for the Rust programming language, handling everything from dependency resolution to compilation and distribution. It uses a declarative Cargo.toml manifest file to specify project metadata and dependencies with semantic versioning, automatically resolving dependency trees and downloading from the crates.io registry. Cargo not only manages packages but acts as the primary build tool — it invokes the Rust compiler (rustc) with the correct flags, manages feature flags, runs tests with cargo test, generates documentation with cargo doc, and benchmarks code with cargo bench. Workspaces enable monorepo management with shared dependency resolution, while the build.rs script system supports code generation at compile time. Cargo's tight integration with the Rust ecosystem has been instrumental to the Rust developer experience and community growth.

Links

Key Features

Declarative Cargo.toml manifestscrates.io registry integrationSemantic versioningWorkspace monorepo supportBuilt-in testing and benchmarkingDocumentation generationFeature flag management