I thought I understaood dependency resolutions in rust, but clearly I dont.
I am working on a large project and it has this dep
tempfile = "3.4"
cargo tree says
PS C:\play\gitui> cargo tree -i tempfile
tempfile v3.4.0
└── asyncgit v0.22.1 (C:\play\gitui\asyncgit)
(nothing special about this dependency, I was trying to resolve clippy complaints about multiple version of same crate and this was one of the crates pulling in a conflicting version)
When I run clippy I got
error: multiple versions for dependency `windows-sys`: 0.42.0, 0.45.0
Some investigation shows that I probably should upgrade to 3.5
So i changed to
tempfile = "3.5"
I now get a huge storm of multiple version conflicts. So I think OK I will go back to 3.4
tempfile = "3.4"
but this is ignored, I am now stuck with 3.5. Cargo tree agrees
PS C:\play\gitui> cargo tree -i tempfile
tempfile v3.5.0
└── asyncgit v0.22.1 (C:\play\gitui\asyncgit)
└── gitui v0.22.1 (C:\play\gitui)
OK so questions
- given that 3.4 can be replaced by 3.5 anyway why didnt I get 3.5 in the first place
- can I get back to using 3.4. So far I only found that deleting the directory and recloning works. Which seems a bit harsh
Further.
I have dependency on notify 5.1.0, that version depends on windows-sys 0.42.0 in its cargo.toml. This is one of the contributors to the version clash. But why doesnt it use 0.45.0 given that
- its a more recent version that matches 0.42.0
- I already have 0.45.0 in my tree for other dependeies