Skip to content

Cargo.lock file should contain a comment describing what it is #5048

Closed
@omertuc

Description

Cargo's .lock file has a very confusing name, it looks like some sort of locking mechanism to prevent two Cargo instances from modifying the same repo (similar to Git's lock file). I think there should be a comment inside it describing that's it's not a simple lock file, it's automatically generated, and shouldn't be modified/deleted. Maybe that comment should link to some more broad explanation.

I'm kinda new to Rust and at first when I tried to compile my project I saw that Cargo generated a Cargo.lock file. My first instinct was thinking "oh no the last instance of cargo didn't close correctly and didn't delete its .lock file I should probably delete it".

Then after I read some basic Cargo tutorial I saw its actual purpose and that it should even be committed to the VCS for repositories of an executable. That surprised me a lot, it was very counter intuitive, given its name.

What do you think?

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions