fix: cargo install uses Cargo.lock for installation by hofbi · Pull Request #3481 · pre-commit/pre-commit · GitHub
Skip to content

fix: cargo install uses Cargo.lock for installation#3481

Closed
hofbi wants to merge 2 commits intopre-commit:mainfrom
hofbi:patch-1
Closed

fix: cargo install uses Cargo.lock for installation#3481
hofbi wants to merge 2 commits intopre-commit:mainfrom
hofbi:patch-1

Conversation

@hofbi
Copy link
Copy Markdown

@hofbi hofbi commented Jun 7, 2025

According to the cargo documentation, cargo does not care about the lockfile by default but will recompute which versions of dependencies to use. This can lead to issues such as EmbarkStudios/cargo-deny#771 where the release of a new upstream dependency breaks an existing unchanged pipeline.

Adding --locked to the cargo install to to force Cargo to use the packaged Cargo.lock file if it is available which should make rust hooks more reproducible.

Comment thread pre_commit/languages/rust.py Outdated
@asottile
Copy link
Copy Markdown
Member

asottile commented Jun 7, 2025

@asottile asottile closed this Jun 7, 2025
@hofbi
Copy link
Copy Markdown
Author

hofbi commented Jun 7, 2025

I could not find anything related. The only open PR related to rust that I could find is #3235, which seems to be a new feature. Also, the last update was 10 months ago. Or is there anything you are working on which you did not push yet?

I am pretty sure, you understand the importance of lock files, so I wanted to make sure that this issue is fixed in time, being it with my PR or from someone else.

@hofbi
Copy link
Copy Markdown
Author

hofbi commented Jun 9, 2025

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants