From 80b8e665f7c08045ba62cf80cc26856742580c87 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 13 May 2026 12:04:00 +0200 Subject: [PATCH] chore: enable bevy/debug and bevy/track_location by default via dev feature Cargo features cannot be scoped to a build profile, so add a `dev` feature that pulls in `bevy/debug` and `bevy/track_location` and make it a default feature. This surfaces real type names and source locations in ECS panics (e.g. B0001 query conflicts) for normal `cargo build` / `cargo run` / `cargo test`, at the cost of a small overhead. Shipping builds opt out with `--release --no-default-features`. Removes the now-redundant `[dev-dependencies] bevy = { features = ["debug"] }` override, since the default feature already covers test builds. --- Cargo.toml | 7 ++++--- README.md | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8d23f96..1db0865 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,12 +3,13 @@ name = "bglga" version = "0.1.0" edition = "2021" +[features] +default = ["dev"] +dev = ["bevy/debug", "bevy/track_location"] + [dependencies] bevy = "0.18" fastrand = "2.0.1" serde = { version = "1", features = ["derive"] } serde_json = "1" dirs = "6" - -[dev-dependencies] -bevy = { version = "0.18", features = ["debug"] } diff --git a/README.md b/README.md index f43b613..6cd7176 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,15 @@ The game features: nix develop --command cargo build ``` +The `dev` cargo feature is enabled by default and turns on `bevy/debug` and +`bevy/track_location` so ECS panics (e.g. `B0001` query conflicts) report +real type names and source locations. For a shipping release build, disable +it: + +``` +nix develop --command cargo build --release --no-default-features +``` + ## How to Test ```