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

Cargo generate-lockfile picks dependencies that are too high for my current rustc #13673

Closed
zaporter opened this issue Mar 31, 2024 · 1 comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@zaporter
Copy link

zaporter commented Mar 31, 2024

Problem

If I delete my Cargo.lock and run cargo generate-lockfile, it picks clap_builder v4.5.2 which requires rustc 1.74 or newer. However, I am on 1.71 (and cannot upgrade yet due to toolchain reasons).

I have tried specifying rust-version = "1.71" in my Cargo.toml, however, that doesn't seem to have worked (I expect it would.)

It seems like cargo should only pick dependency versions that will actually compile on my version of rustc or should obey my rust-version

Steps

No response

Possible Solution(s)

If we don't want to auto-restrict to my version of rustc (or my rust-version in my cargo.toml), I think we could add an opt-in flag to restrict dependencies to a certain rustc version

Notes

No response

Version

cargo 1.71.0-nightly (cfd3bbd8f 2023-06-08)
release: 1.71.0-nightly
commit-hash: cfd3bbd8fe4fd92074dfad04b7eb9a923646839f
commit-date: 2023-06-08
host: x86_64-unknown-linux-gnu
libgit2: 1.6.4 (sys:0.17.1 vendored)
libcurl: 8.0.1-DEV (sys:0.4.61+curl-8.0.1 vendored ssl:OpenSSL/1.1.1t)
ssl: OpenSSL 1.1.1t  7 Feb 2023
os: Debian 12 (bookworm) [64-bit]
@zaporter zaporter added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Mar 31, 2024
@weihanglo
Copy link
Member

There is an unstable flag -Zmsrv-polocy for this, and it is still under development.

See also

Close in favour of aforementioned issues. Thanks for the report.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Mar 31, 2024
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

2 participants