bevy
bevy copied to clipboard
Can not add bevy, bevy_render depends on wgpu missing features
Bevy version
git head
[Optional] Relevant system information
Generic linux
What you did
Try 1:
cargo new foobar
cd foobar
cargo add bevy
Try 2, edit the Cargo.toml directly then cargo build:
[package]
name = "bevy-hello-world"
version = "0.1.0"
edition = "2021"
[dependencies]
# bevy = "0.15"
bevy = { git = "https://github.com/bevyengine/bevy", commit = "c425c32064b81b8bf23f882c97f818309c48bded" }
wgpu = { git = "https://github.com/gfx-rs/wgpu", commit = "1ea5498038b2fd0392bd6cbd81ec71b2438e5c95" }
Try 3, use bevy examples:
git clone https://github.com/bevyengine/bevy
cd bevy
cargo run --example hello_world # or try with various related --features
What went wrong
I'm seeing:
error: failed to select a version for `wgpu`.
... required by package `bevy_render v0.15.0-dev (/home/tommd/dev/bevy/crates/bevy_render)`
... which satisfies path dependency `bevy_render` of package `bevy_animation v0.15.0-dev (/home/tommd/dev/bevy/crates/bevy_animation)`
versions that meet the requirements `^23.0.1` are: 23.0.1
the package `bevy_render` depends on `wgpu`, with features: `naga` but `wgpu` does not have these features.
It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name.
or replace naga with hal or various other features depending on invocation.
The code is built successfully in CI, and I can't reproduce locally.
When looking at the wgpu dependency of bevy_render, it doesn't add those features https://github.com/bevyengine/bevy/blob/c425c32064b81b8bf23f882c97f818309c48bded/crates/bevy_render/Cargo.toml#L71-L77
I don't know how you're having that error 🙁
Which version of Rust are you using?
Why is bevy_render version 0.15-dev?
try 2 and 3 are from main which is 0.15.0-dev
@mockersf It was rust 1.70.x
Updated to rust 1.81.0 (had it laying around) and the result is:
error: rustc 1.81.0 is not supported by the following packages:
[email protected] requires rustc 1.82.0
[email protected] requires rustc 1.82.0
[email protected] requires rustc 1.82.0
Ahhh. So I went all the way to latest stable of 1.83.0. It "works" (modulo nixos stuff but that's expected)
I can't answer for how cargo (perhaps) resolved package dependencies and led to the earlier error, but a very new rustc was indeed the solution. Newer than I imagined was necessary.
Bevy requirements tend to be very close to "latest stable rust", but that error was very not clear