Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
omertuc opened this issue Feb 17, 2018 · 2 comments
Closed

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

omertuc opened this issue Feb 17, 2018 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@omertuc
Copy link

omertuc commented Feb 17, 2018

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?

@alexcrichton alexcrichton added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Feb 18, 2018
@DarkDrek
Copy link
Contributor

Any ideas for the exact text?
Maybe?

This is not a simple lock file, it's automatically generated, and shouldn't be modified! See https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html for more information.

@dwijnand
Copy link
Member

Ah, an older duplicate of #6180.

This has been resolved with #6548.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

4 participants