Skip to content

"all possible versions conflict with previously selected packages" error is not giving the appropriate diagnostic #10189

Open

Description

Problem

I'm getting the "all possible versions conflict with previously selected packages" error even though there are valid versions available according to the diagnostic:

error: failed to select a version for `memchr`.
    ... required by package `nom v6.2.1`
    ... which satisfies dependency `nom = "^6.2.1"` of package `saphir v2.8.2 (https://github.com/CBenoit/saphir?branch=hyper-update#dff5d11a)`
    ... which satisfies git dependency `saphir` (locked to 2.8.2) of package `devolutions-gateway v2021.1.7 ([…]/devolutions-gateway/devolutions-gateway)`
versions that meet the requirements `>=2.0, <2.4` are: 2.3.4, 2.3.3, 2.3.2, 2.3.0, 2.2.1, 2.2.0, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.2, 2.0.1, 2.0.0

all possible versions conflict with previously selected packages.

  previously selected package `memchr v2.4.0`
    ... which satisfies dependency `memchr = "^2.2"` of package `futures-util v0.3.18`
    ... which satisfies dependency `futures-util = "^0.3"` of package `async-tungstenite v0.16.1`
    ... which satisfies dependency `async-tungstenite = "^0.16.1"` of package `jetsocat v2021.1.7 ([…]/devolutions-gateway/jetsocat)`

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

Looking at this diagnostic, I understand that memchr v2.3.4 would satisfy both >=2.0, <2.4 and memchr = "^2.2" and no error should occurs.

In fact, the real issue is that os_str_bytes = "^6.0", which is depended on by some other package, is requiring memchr = "^2.4", but the diagnostic doesn't include this information.

Steps

git clone --depth=1 --single-branch --branch failing-package-selection git@github.com:Devolutions/devolutions-gateway.git
cd devolutions-gateway
cargo check

Notes

I was able to obtain a useful diagnostic by adding memchr = "~2.3.4" to one of the Cargo.toml:

error: failed to select a version for `memchr`.
    ... required by package `os_str_bytes v6.0.0`
    ... which satisfies dependency `os_str_bytes = "^6.0"` of package `clap v3.0.0-rc.3`
    ... which satisfies dependency `clap = "^3.0.0-rc.3"` of package `tokengen v0.1.0 ([…]/devolutions-gateway/tools/tokengen)`
versions that meet the requirements `^2.4` are: 2.4.1, 2.4.0

all possible versions conflict with previously selected packages.

  previously selected package `memchr v2.3.4`
    ... which satisfies dependency `memchr = "~2.3.4"` of package `devolutions-gateway v2021.1.7 ([…]/devolutions-gateway/devolutions-gateway)`

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

Version

cargo 1.57.0 (b2e52d7ca 2021-10-21)
release: 1.57.0
commit-hash: b2e52d7cab0a286ee9fcc0c17510b1e72fcb53eb
commit-date: 2021-10-21
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:OpenSSL/1.1.1l)
os: openSUSE 20211111 [64-bit]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-dependency-resolutionArea: dependency resolution and the resolverArea: dependency resolution and the resolverA-diagnosticsArea: Error and warning messages generated by Cargo itself.Area: Error and warning messages generated by Cargo itself.C-bugCategory: bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions