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

Checking in Cargo.lock #1103

Closed
Hofer-Julian opened this issue Feb 26, 2025 · 3 comments · Fixed by #1117
Closed

Checking in Cargo.lock #1103

Hofer-Julian opened this issue Feb 26, 2025 · 3 comments · Fixed by #1117

Comments

@Hofer-Julian
Copy link
Collaborator

Hofer-Julian commented Feb 26, 2025

Like many Rust libraries, we don't check Cargo.lock into git. I think we should re-evalutate that decision.

Lock files have many advantages. For downstream Cargo.lock is disregarded, so only advantages for rattler developers matter:

  • Multiple checkouts of the same commit have the same dependency tree (you and CI, you and your colleague)
  • You can go back to older commits and have the same dependency tree as when the commit was made

The main argument against checking in the lock file is, that as mentioned before, the dependencies of downstream users will be locked differently. A new version of your dependencies might break your users' setup when they update, but you don't notice since the dependencies are locked.

With Dependabot that problem is easily avoided. You just let it update your Cargo.lock on a regular basis and merge the PR if CI is green and deal with the problem if CI is red. It's even nicer since you see which crates updated and are therefore responsible for the breakage.

That is one of the reasons why the Cargo team moved away from their recommendation to "commit Cargo.lock file for packages with binaries but not libraries": https://blog.rust-lang.org/2023/08/29/committing-lockfiles.html

The new msrv aware resolver should avoid even further breakage for downstream users that we have to keep in mind.

@Hofer-Julian Hofer-Julian changed the title Check in Cargo.lock Checking in Cargo.lock Feb 26, 2025
@pavelzw
Copy link
Contributor

pavelzw commented Feb 27, 2025

another argument:
with rattler-index we actually sort-of ship binaries (we don't build them here but to conda-forge). at least for the rattler-index build i would prefer a lockfile rather than yolo-building in conda-forge CI

@baszalmstra
Copy link
Collaborator

It makes sense to me, both py-rattler and js-rattler also have checked in lock-files.

@pavelzw
Copy link
Contributor

pavelzw commented Feb 27, 2025

#1117

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 a pull request may close this issue.

3 participants