Skip to content

What's the consequences of versioning Cargo.lock? #277

Answered by kpreid
paul-hansen asked this question in Q&A
Discussion options

You must be logged in to vote

The documentation here seems to suggest it's enforced

No, the opposite. This sentence is describing Cargo's behavior:

Users dependent on the library will not inspect the library’s Cargo.lock (even if it exists).

(There is one case where a published package's lockfile is consulted, and that is cargo install --locked.)

The recommendation to not check in lock files for libraries is due to the fact the lockfile won't be used by dependents, and therefore the library development process should not assume a particular lockfile state. Also, the recommendation is likely to be changed to the opposite.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@paul-hansen
Comment options

Answer selected by paul-hansen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants