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

Add Cargo.lock to git. #1019

Closed
the-kenny opened this issue Jun 16, 2016 · 9 comments
Closed

Add Cargo.lock to git. #1019

the-kenny opened this issue Jun 16, 2016 · 9 comments
Labels
S-needs-discussion Status: Needs further discussion before merging or work can be started

Comments

@the-kenny
Copy link

the-kenny commented Jun 16, 2016

To make builds reproducible, projects building executables should add their Cargo.lock to their git repository. This is also noted in http://doc.crates.io/faq.html#why-do-binaries-have-cargolock-in-version-control-but-not-libraries

Doing this also makes packaging for distributions (in my case NixOS) much easier as it's guaranteed that the dependencies won't change between two builds.

@mcarton
Copy link
Member

mcarton commented Jun 16, 2016

The main crate has both a plugin and a binary, what should we do about that?

@mcarton mcarton added the S-needs-discussion Status: Needs further discussion before merging or work can be started label Jun 16, 2016
@killercup
Copy link
Member

@mcarton I'm fairly certain Cargo will ignore the lock file when clippy is used as a library. So the lock file would only affect cargo install clippy and manual builds.

@the-kenny
Copy link
Author

That sounds like a nice solution :)
Am 17.06.2016 20:34 schrieb "Pascal Hertleif" notifications@github.com:

@mcarton https://github.com/mcarton I'm fairly certain Cargo will
ignore the lock file when clippy is used as a library. So the lock file
would only affect cargo install clippy and manual builds.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Manishearth/rust-clippy/issues/1019#issuecomment-226847296,
or mute the thread
https://github.com/notifications/unsubscribe/AAB5v1nF42MMyw_DINDVCPsxKuogfQo1ks5qMujPgaJpZM4I3Pdc
.

@the-kenny
Copy link
Author

Any updates on this? I think the comment of @killercup clears the way to include Cargo.lock in the repository.

@Manishearth
Copy link
Member

IIRC the lock file won't affect cargo install, it only affects using the library as a git clone, which is a rare use case (only clippy devs, basically). I'm not sure of this though.

@the-kenny
Copy link
Author

As I mention in the opening description: A Cargo.lock file is crucial to get reproducible builds. This is not only useful for development (as every developer will have the same set of dependencies, which makes it easy to reproduce bugs), but also useful for people trying your package your software for distribution.

Please take a look at this and this for a detailed description of the benefits.

@Manishearth
Copy link
Member

I know why it's useful, I was just wondering if it applied to binaries. Turns out it does, so we can go ahead with this 😄

@sanmai-NL
Copy link
Contributor

@Manishearth @the-kenny: seems like a small PR is still needed to close this.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 12, 2018

We can't do this due to the rustc integration, where we are in the rustc workspace. we used to have it but removed it during the merger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-needs-discussion Status: Needs further discussion before merging or work can be started
Projects
None yet
Development

No branches or pull requests

7 participants