Skip to content

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

Closed as not planned
@zaporter

Description

@zaporter

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions