Cargo.lock file should contain a comment describing what it is #5048
Labels
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
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?
The text was updated successfully, but these errors were encountered: