Skip to content

Build failure: Dependency conflict on time crate (between 0.3.45 and 0.3.46) #621

@rxdiscovery

Description

@rxdiscovery

I am encountering a dependency resolution error when trying to build the project using cargo build.

Cargo fails to select a compatible version for the time crate. It appears that zip v7.3.0 strictly requires time =0.3.45, while another dependency in the tree (or the lockfile) has selected time 0.3.46.

To Reproduce

Run cargo build with the latest dependencies.

Error Log

Here is the output from Cargo:

error: failed to select a version for `time`.
    ... required by package `zip v7.3.0`
    ... which satisfies dependency `zip = "^7.3.0"` of package XXXX
versions that meet the requirements `=0.3.45` are: 0.3.45

all possible versions conflict with previously selected packages.

  previously selected package `time v0.3.46`
    ... which satisfies dependency `time = "^0.3.46"` of package XXXX

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

Possible Solution

remove '=' from :

time = { version = "=0.3.45", default-features = false, optional = true, features = [
    "std",
] }

time = { version = "=0.3.45", features = ["formatting", "macros"] }
clap = { version = "=4.4.18", features = ["derive"] }

I think that fixing/pinning crate versions (using =) risks causing recurring dependency conflicts in the future. By restricting a dependency to a specific patch version, it prevents Cargo's resolver from finding a common version when multiple packages share the same dependency. It might be better to use a more flexible version range.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions