Compiler breaks when `dev` feature is active without the `3d` one

Aperta
#26,618 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Start by tracing bevy_dev_tools::render_debug::init_render_debug_overlay_pipeline and the feature gates for the dev, 2d, and 3d features; the reported failure is a missing MeshPipelineViewLayouts resource with 3d disabled. Check the related fix in issue #23673 and reproduce with the listed Bevy features. Done when the dev feature works with 2d and ui without default features, and the relevant regression test passes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

C-Bug S-Needs-Triage

Bevy version and features

I am using Bevy 0.20.1 with default-features disabled : default-features = false, features = ["2d", "ui", "dev"].

What you did

I just started a fresh project were I wanted to work on some 2D game. So I disabled the default features, only to allow 2d and ui. This works perfectly well, but as soon as I also added the dev feature too (to monitor framerate, entities, etc.) the compiler breaks.

You can see my cargo.toml here :

[package]
name = "jeu"
version = "0.1.0"
edition = "2024"

[dependencies]
bevy = { version = "0.20.1", default-features = false, features = ["2d", "ui", "dev"] }
rand = "0.10.4"

# Enable a small amount of optimization in the dev profile.
[profile.dev]
opt-level = 1

# Enable a large amount of optimization in the dev profile for dependencies.
[profile.dev.package."*"]
opt-level = 3

What went wrong

Here is the error message when compiling with the dev feature without the default-features :

thread 'main' (11376) panicked at /home/xxxxxx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bevy_ecs-0.20.1/src/error/handler.rs:128:1:
Encountered an error in system `bevy_dev_tools::render_debug::init_render_debug_overlay_pipeline`: Parameter `Res<MeshPipelineViewLayouts>` failed validation: Resource does not exist
If this is an expected state, wrap the parameter in `Option<T>` and handle `None` when it happens, or wrap the parameter in `If<T>` to skip the system when it happens.

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2026-11-20T09:20:43.562720Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562725Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562729Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562732Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562737Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562741Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562744Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562748Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562750Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562754Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562757Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562761Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562767Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?
2026-11-20T09:20:43.562771Z  WARN bevy_ecs::world::command_queue: CommandQueue has un-applied commands being dropped. Did you forget to call SystemState::apply?

Additional information

From what I've seen, this migh be an issue caused by the absence of some features available in the 3d feature that are used by the dev one (something about pbr, but I am not quite sure what it is).

A similar issue has been posted and marked as resolve (https://github.com/bevyengine/bevy/issues/23673) but it seems that is is still not working.

Lingua principale
Rust
Stelle
49.8k
Fork
5.1k
Merge medio
3g 4h
PR unite (30g)
136

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bevyengine/bevy

Tutte le issue di bevyengine/bevy

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.