On old Cargo.lock, cannot compile kas-wgpu due to 2 versions of raw-window-handle #261
Replies: 3 comments 4 replies
-
From the perspective of KAS (as a downstream crate), we could fix this by adding a dependency on We could also detect this type of issue via CI with Want to make a PR? |
Beta Was this translation helpful? Give feedback.
-
I think weak dependency features are what is actually wanted. In any case, it doesn't matter here because
Agreed. You can kind of get around this by renaming dependencies but it's a pain, and requires caution when adding optional dependencies.
While the non-obvious method resolution is annoying, this is a very useful feature, and much less insidious behaviour than in is common in languages like C/C++. Using
Yup, probably several crates would need the minimum patch version bumping. Possibly also in dependencies, since many crates don't bother declaring correct minimum versions (which again, can be "fixed" via extra dependencies within this library, but is annoying to do). I've lost track of how many times I've told people "just do |
Beta Was this translation helpful? Give feedback.
-
To match requirements, yes. E.g. if after the repo is updated, there is a dependency on crate
Both.
The idea is to fix this via whatever version-bumps are needed.
It should be removed when WGPU is updated. It shouldn't break anything (even if it's not removed, then it's just an unneeded dependency).
I don't think this is viable. There are basically two paths:
Perhaps there is a workable fix within Cargo actually (roughly what you suggested):
But really I think we should just accept that this is never going to be perfect. |
Beta Was this translation helpful? Give feedback.
-
On an older Cargo.lock, when I try building master 0c6b51f on rustc 1.57.0 (f1edd0429 2021-11-29), I get an error:
Build output
cargo tree
shows that winit v0.26.0 uses raw-window-handle v0.4.2, while wgpu v0.11.1 (and other libraries?) uses raw-window-handle v0.3.3.Deleting Cargo.lock fixed this issue, but I kinda feel it's a bug in Cargo.toml for KAS to depend on multiple libraries using the same raw-window-handle version, but not actually enforce it. Is this resolvable, or impossible due to Cargo limitations? Do you plan to address this or not?
Seems there's some related discussion at rust-lang/cargo#8178 and rust-lang/rust#44663 (but unresolved).
Beta Was this translation helpful? Give feedback.
All reactions