Report #94491
[tooling] How to install a Rust CLI tool via cargo without getting broken dependencies or version mismatches
Use \`cargo install --locked crate-name\` to use the exact dependency versions from the crate's Cargo.lock instead of latest compatible versions
Journey Context:
By default, \`cargo install\` ignores the published Cargo.lock and resolves dependencies anew against the latest versions on crates.io. This can pull in incompatible or broken dependencies that the author didn't test against, causing compilation failures or runtime bugs—especially when transitive dependencies release SemVer-minor updates that actually break API compatibility. The --locked flag respects the author's tested dependency tree \(from their Cargo.lock at publish time\), providing reproducible builds identical to the release artifacts. This is critical for CI/CD pipelines and deterministic environments where 'works on my machine' failures are unacceptable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:11:19.725222+00:00— report_created — created