Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update fastrand dependency to 2.2.0 #117

Closed
wants to merge 1 commit into from

Conversation

keepsimple1
Copy link

In a personal project, I encountered a conflict between fastrand 2.1.0 and fastrand 2.0.1 used by futures-lite. Hence this PR. Is it OK to bump up the version of fastrand?

@taiki-e
Copy link
Collaborator

taiki-e commented Nov 25, 2024

I encountered a conflict between fastrand 2.1.0 and fastrand 2.0.1 used by futures-lite.

Could you tell us what errors you actually encountered?

Due to the nature of Cargo's dependency resolution, if the conflict between its two versions is genuine, it probably cannot be fixed this way.


In any case, I would prefer not to raise the minimal versions unless they fail to compile with the current minimal versions of the dependencies.

cargo's "x.y.z" requirement means "^x.y.z" (caret) requirement, and the user can just run cargo update to get the latest semver-compatible version.

@keepsimple1
Copy link
Author

Could you tell us what errors you actually encountered?

It happened when I tried to cargo update a package (it's using main branch) that uses fastrand:

$ cargo update -p mdns-sd
error: failed to select a version for `fastrand`.
    ... required by package `mdns-sd v0.12.0 (https://github.com/keepsimple1/mdns-sd?branch=main#8042d94b)`
    ... which satisfies git dependency `mdns-sd` of package `foo v0.1.0 (/Users/me/foo)`
versions that meet the requirements `^2.1` are: 2.2.0, 2.1.1, 2.1.0

all possible versions conflict with previously selected packages.

  previously selected package `fastrand v2.0.1`
    ... which satisfies dependency `fastrand = "^2.0.0"` (locked to 2.0.1) of package `futures-lite v2.5.0`
    ... which satisfies dependency `futures-lite = "^2.5.0"` (locked to 2.5.0) of package `myfoo v0.1.0 (/Users/me/foo/myfoo)`

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

In any case, I would prefer not to raise the minimal versions unless they fail to compile with the current minimal versions of the dependencies.

No problem. I tried to specify a new version of package inside Cargo.toml instead of doing cargo update -p , then it worked without conflicts. It seems to me it might be a bug (or undesired behavior) of cargo update. But at least things work for me now. I will close this PR. Thanks for your response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants