Ray's Knowledge Base
Unlock

cargo install --path ignores Cargo.lock unless you pass --locked

FactVerified 1 Oct 2026Holds anywhere
Fact. A statement and the evidence for it.

Statement#

cargo install --path <crate> resolves the dependencies again. It does not use the versions in Cargo.lock. Pass --locked to install the lockfile versions:

cargo install --path crates/<crate> --locked

Evidence#

Seen in the rgit workspace on 2026-09-30: cargo install --path crates/rgit-cli resolved the dependencies again, and cargo install --path crates/rgit-cli --locked used the lockfile versions.