You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of the same application, I have been trying to use both wgpu 0.9 (for rendering only) and wgpu 0.11 (for compute only). However, it appears that adding both wgpu 0.9 and wgpu 0.11 dependencies yields a Cargo error:
Execution failed (exit code 101).
C:/Users/devel/.cargo/bin/cargo.exe metadata --verbose --format-version 1 --all-features
stdout : Updating crates.io index
error: failed to select a version for `web-sys`.
... required by package `wgpu v0.11.0`
... which satisfies dependency `wgpu11 = "^0.11"` of package `wgpu_test v0.1.0 (C:\Users\devel\work\trash\wgpu-test)`
versions that meet the requirements `^0.3.53` are: 0.3.55, 0.3.54, 0.3.53
all possible versions conflict with previously selected packages.
previously selected package `web-sys v0.3.50`
... which satisfies dependency `web-sys = "=0.3.50"` of package `wgpu v0.9.0`
... which satisfies dependency `wgpu = "^0.9"` of package `wgpu_test v0.1.0 (C:\Users\devel\work\trash\wgpu-test)`
failed to select a version for `web-sys` which could resolve this conflict
I understand that this is caused by the fact that we depend on two different versions of the same native library, which could cause link issues (and I guess that’s why we have a links entry on that Cargo.toml on the wasm-bindgen project). However, that web-sys dependency should be enabled only when targeting WASM:
[target.'cfg(target_arch="wasm32")'.dependencies]
wasm-bindgen = "0.2.76"# remember to change version in wiki as wellweb-sys = { version = "0.3.53", features = [
In my case I’m only targeting native platforms and am OK having the web target fail to compile.
Is there a way not to have this dependency conflict for native dependencies that are not enabled for the platform I’m targetting?
Steps
cargo new wgpu_test
Copy the following Cargo.toml file:
[package]
name = "wgpu_test"version = "0.1.0"edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
wgpu = "0.9"wgpu11 = { package = "wgpu", version = "0.11" }
sebcrozet
changed the title
Conflict between native dependencies only enabled for targets we don’t target
Conflict between native dependencies only enabled for targets we don’t care about
Nov 19, 2021
Problem
As part of the same application, I have been trying to use both
wgpu 0.9
(for rendering only) andwgpu 0.11
(for compute only). However, it appears that adding bothwgpu 0.9
andwgpu 0.11
dependencies yields a Cargo error:I understand that this is caused by the fact that we depend on two different versions of the same native library, which could cause link issues (and I guess that’s why we have a
links
entry on thatCargo.toml
on thewasm-bindgen
project). However, thatweb-sys
dependency should be enabled only when targeting WASM:In my case I’m only targeting native platforms and am OK having the web target fail to compile.
Is there a way not to have this dependency conflict for native dependencies that are not enabled for the platform I’m targetting?
Steps
cargo new wgpu_test
Cargo.toml
file:cargo check
will fail.Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: