Skip to content

Conversation

Noah765
Copy link
Contributor

@Noah765 Noah765 commented Jun 2, 2025

Committing the Cargo.lock file ensures a reproducible build. This is recommended by the Cargo Book's best practices guide: https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html. If you have a reason not to commit this file, feel free to close this pull request.

Context

I am currently working on adding rinf_cli to the nixpkgs repo. Due to the nature of Nix, it is necessary to clearly list all of this package's dependencies. If you don't want to check Cargo.lock into Git, my PR to nixpkgs will include a patch that adds Cargo.lock and is applied before building this package.

Before Committing

dart analyze flutter_package --fatal-infos
dart format .
cargo fmt
cargo clippy --fix --allow-dirty

Committing the Cargo.lock file ensures a reproducible build. This is
recommended by the Cargo Book's best practices guide:
https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html.
@Noah765
Copy link
Contributor Author

Noah765 commented Jun 2, 2025

I missed that checking the Cargo.lock file into VS isn't necessary when using the fetchCrate fetcher. Here is a list of the pros and cons of committing the Cargo.lock file. Decide for yourself if the extra reproducibility is worth the drawbacks.

@temeddix temeddix changed the title Check Cargo.lock into VSC Check Cargo.lock into VCS Jun 2, 2025
@temeddix
Copy link
Member

temeddix commented Jun 2, 2025

Hi, thank you for your contribution :)

For now, the extra reproducibility doesn't seem to be needed, as this repository mostly consists of library crates (except rinf_cli). We're still open to adding Cargo.toml if nixpkgs somehow requires it, so please mention me if you have any updates about this topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants