From deda3f2522d7dd2a99bf0a25655365f1d0e2fd42 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Wed, 20 Nov 2024 14:01:33 -0800 Subject: [PATCH] Fix detailed_trace! (#16452) Alternative to #16450 # Objective detailed_trace! in its current form does not work (and breaks CI) ## Solution Fix detailed_trace by checking for the feature properly, adding it to the correct crates, and removing it from the incorrect crates --- crates/bevy_ecs/Cargo.toml | 1 + crates/bevy_internal/Cargo.toml | 2 +- crates/bevy_render/Cargo.toml | 1 + crates/bevy_utils/Cargo.toml | 1 - crates/bevy_utils/src/lib.rs | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ecs/Cargo.toml b/crates/bevy_ecs/Cargo.toml index 3934a2221c..30117f7127 100644 --- a/crates/bevy_ecs/Cargo.toml +++ b/crates/bevy_ecs/Cargo.toml @@ -18,6 +18,7 @@ bevy_debug_stepping = [] serialize = ["dep:serde"] track_change_detection = [] reflect_functions = ["bevy_reflect", "bevy_reflect/functions"] +detailed_trace = [] [dependencies] bevy_ptr = { path = "../bevy_ptr", version = "0.15.0-dev" } diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index 9e6cdebacc..005bae288a 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -24,7 +24,7 @@ trace = [ trace_chrome = ["bevy_log/tracing-chrome"] trace_tracy = ["bevy_render?/tracing-tracy", "bevy_log/tracing-tracy"] trace_tracy_memory = ["bevy_log/trace_tracy_memory"] -detailed_trace = ["bevy_utils/detailed_trace"] +detailed_trace = ["bevy_ecs/detailed_trace", "bevy_render?/detailed_trace"] sysinfo_plugin = ["bevy_diagnostic/sysinfo_plugin"] diff --git a/crates/bevy_render/Cargo.toml b/crates/bevy_render/Cargo.toml index 0ab710527b..8c1ec9b58d 100644 --- a/crates/bevy_render/Cargo.toml +++ b/crates/bevy_render/Cargo.toml @@ -30,6 +30,7 @@ ci_limits = [] webgl = ["wgpu/webgl"] webgpu = ["wgpu/webgpu"] ios_simulator = [] +detailed_trace = [] [dependencies] # bevy diff --git a/crates/bevy_utils/Cargo.toml b/crates/bevy_utils/Cargo.toml index c1555d8ba9..6eb9a32020 100644 --- a/crates/bevy_utils/Cargo.toml +++ b/crates/bevy_utils/Cargo.toml @@ -18,7 +18,6 @@ std = [ "ahash/runtime-rng", ] alloc = ["hashbrown/default"] -detailed_trace = [] serde = ["hashbrown/serde"] [dependencies] diff --git a/crates/bevy_utils/src/lib.rs b/crates/bevy_utils/src/lib.rs index 1865f62cf9..694c341465 100644 --- a/crates/bevy_utils/src/lib.rs +++ b/crates/bevy_utils/src/lib.rs @@ -411,7 +411,7 @@ pub fn error(result: Result<(), E>) { #[macro_export] macro_rules! detailed_trace { ($($tts:tt)*) => { - if cfg!(detailed_trace) { + if cfg!(feature = "detailed_trace") { $crate::tracing::trace!($($tts)*); } }