Skip to content

When no version is specified, reuse existing locked versions #12046

Open
@epage

Description

@epage

Problem

When developing #12039, I ran cargo add clap into the xtask but that picked the latest clap version, causing more churn to the lockfile than I thought was appropriate for my change.

Proposed Solution

Check the lockfile for the highest version that is semver compatible with the latest version.

  • By limiting it to semver compatible, this avoids the "some random dev dependency is using an old clap" problem (criterion)

Alternatives

  • Pick from non-dev dependencies
  • Pick only if a workspace member depends on it
  • Reject this in favor of workspace inheritance

Notes

We already will auto pick

  • version from alternative dependency table from same package
  • inheriting from workspace.dependencies

See also killercup/cargo-edit#41

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-addS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions