Wgpu-rs: web-sys dependency strangeness

Created on 24 Nov 2020  路  4Comments  路  Source: gfx-rs/wgpu-rs

Updating to latest wgpu-rs I can't get cargo update to complete successfully.

I tried doing cargo new foo and then simply adding wgpu = { git = "https://github.com/gfx-rs/wgpu-rs" } to the dependencies section.

Running cargo run I get:

cargo run
    Updating crates.io index
    Updating git repository `https://github.com/gfx-rs/wgpu-rs`
    Updating git repository `https://github.com/gfx-rs/wgpu`
    Updating git repository `https://github.com/zakarumych/gpu-alloc`
    Updating git repository `https://github.com/gfx-rs/naga`
error: failed to select a version for `web-sys`.
    ... required by package `wgpu v0.6.0 (https://github.com/gfx-rs/wgpu-rs#fd1378b8)`
    ... which is depended on by `foo v0.1.0 (/Users/ln/Downloads/foo)`
versions that meet the requirements `=0.3.45` are: 0.3.45

the package `wgpu` depends on `web-sys`, with features: `GpuMapMode` but `web-sys` does not have these features.
failed to select a version for `web-sys` which could resolve this conflict

I tried removing ~/.cargo/git and ~/.cargo/registry and that didn't help either.

Any ideas?

bug

All 4 comments

Yup, that works around it.

Sounds like the patch section approach described in https://github.com/gfx-rs/wgpu-rs/pull/615#issuecomment-732644297 won't actually work very well here. I'll keep looking into the git dependency so we can remove this, otherwise we'll have to disable the web backend temporarily

I just opened rustwasm/wasm-bindgen#2371 to ask about a new release which would avoid the need for patch here.

If a new release won't happen for a while, we could still at least document the patch section workaround a bit to make it less confusing for anyone trying to use wgpu-rs master

Was this page helpful?
0 / 5 - 0 ratings