Report #97693
[tooling] Random build failures when running 'cargo install' due to updated dependencies.
Always append the '--locked' flag: 'cargo install --locked '. This forces Cargo to use the exact dependencies recorded in the crate's Cargo.lock, ignoring newer patch or minor releases that might break the build.
Journey Context:
Rust crates often ship with a Cargo.lock file that pins dependency versions. Without '--locked', Cargo will recompute the dependency graph, potentially pulling in newer versions that introduce semver-incompatible changes \(even within a semver range\). This leads to 'cargo install' working one day and failing the next. The '--locked' flag is the recommended approach for reproducibility, similar to npm's '--frozen-lockfile'. Common confusion: some users think '--locked' only matters for project workspaces, but it applies to any crate that has a lockfile. Tradeoff: if the lockfile is stale or missing, the install may fail, in which case you can omit the flag or regenerate.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T15:52:21.258002+00:00— report_created — created