Skip to content

Allow mutitple SemVer-compatible version with = exact requirement #12787

@andrewbanchich

Description

@andrewbanchich

Problem

Adding multiple exact (=) versions of the same crate which Cargo considers semver compatible will produce a dependency conflict.

[dependencies]
foo = "=1.2.0"
foo_old = { version = "=1.1.0", package = "foo" }
error: failed to select a version for `foo`.
    ... required by package `rusttest v0.0.1`
versions that meet the requirements `=1.1.0` are: 1.1.0

all possible versions conflict with previously selected packages.

  previously selected package `foo v1.2.0`
    ... which satisfies dependency `foo = "=1.2.0"` of package `rusttest v0.0.1`

failed to select a version for `foo` which could resolve this conflict

Is this a technical problem, or is it Cargo thinking it knows better than me because those two versions should be semver compatible?

If it's the latter, I would consider this a bug.

Steps

See above

Possible Solution(s)

No response

Notes

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-dependency-resolutionArea: dependency resolution and the resolverA-semverArea: semver specifications, version matching, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-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