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

crate version mismatch between cargo.toml and cargo.lock #12129

Closed
Mohan6677 opened this issue May 11, 2023 · 4 comments
Closed

crate version mismatch between cargo.toml and cargo.lock #12129

Mohan6677 opened this issue May 11, 2023 · 4 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@Mohan6677
Copy link

Problem

When i am running cargo build --release in one of my projects. Cargo is downloading and compiling latest versions of crates mentioned in cargo.toml instead of the version i specified. so some of the latest crates which are getting downloaded have a msrv of 1.65 but i am using 1.64 because of which i am not able to compile my code and generate a binary. i haven't changes anything in my code recently. i am unable to find the cause behind this behaviour. Any help would be much appreciated!!.

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.64.0 (387270bc7 2022-09-16)
release: 1.64.0
commit-hash: 387270bc7f446d17869c7f208207c73231d6a252
commit-date: 2022-09-16
host: aarch64-apple-darwin
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.87.0 (sys:0.4.55+curl-7.83.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
os: Mac OS 13.3.1 [64-bit]
@Mohan6677 Mohan6677 added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels May 11, 2023
@epage
Copy link
Contributor

epage commented May 11, 2023

cargo uses maximal compatible versions by default, rather than minimal compatible versions.

#8539 is for supporting minimal versions.

#9930 is for making the resolver MSRV-aware (hopefully by default)

I believe those capture the concerns mentioned in this issue, so I'm closing in favor of those. If there is something I missed, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2023
@Mohan6677
Copy link
Author

what can i do to strictly generate the binary with exact versions of dependencies i specified in cargo.toml?

@weihanglo
Copy link
Member

Tracking Cargo.lock in your version control system is probably the best way I know at this moment.

@Mohan6677
Copy link
Author

@weihanglo. yes i am not checking in cargo.lock file. i think that's what caused the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants