Skip to content

Generate "Cargo.lock" for old Rust compiler #13503

Closed as not planned
Closed as not planned
@P1119r1m

Description

@P1119r1m

Problem

I have a project written in Rust.
It was compiled without problems using the Rust compiler version "1.64.0".
At some point I decided to do:

cargo update

As a result, the "Cargo.lock" file was updated and now I can't build the project:

error: package regex-syntax v0.8.2 cannot be built because it

requires rustc 1.65 or newer... ... error: package home v0.5.9

cannot be built because it requires rustc 1.70.0 or newer...

Previous version of the "Cargo.lock" file wasn't saved.

Also I don't want (cannot) update my Rust compiler. It is written by 3rd-party vendor.

Is it possible to:

  • recover the possibility to build my project using old Rust "1.64.0"?
  • generate a "Cargo.lock" file for a specific version of the Rust compiler?

If yes, then how?
If no - that's the matter of the current feature request.

Proposed Solution

cargo generate-lockfile --rustc-version=1.64.0

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lockfileArea: Cargo.lock issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-generate-lockfileS-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