cargo lockfile
also: Cargo.lock, lockfile
A file that records the exact versions of all dependencies used in a Rust project, ensuring reproducible builds across machines and time.
The Cargo.lock file is generated and maintained by Cargo, Rust's package manager. It captures the precise version of every direct and transitive dependency resolved during a build, creating a snapshot of your project's dependency tree at a specific moment.
When you run cargo build, Cargo resolves version constraints from Cargo.toml (which may specify ranges like 1.2.*) into exact versions and writes them to Cargo.lock. On subsequent builds—whether on your machine, a teammate's machine, or a CI/CD server—Cargo uses the locked versions, guaranteeing identical builds.
For library projects, Cargo.lock is typically committed to version control; for binary applications, it should always be committed. This prevents "dependency drift," where minor version updates introduce subtle bugs or incompatibilities.