Skip to content

Commit ad8d8db

Browse files
committed
Revert "Allow partial support for bevy_log in no_std (bevyengine#18782)"
This reverts commit ac52cca.
1 parent 88f863e commit ad8d8db

File tree

15 files changed

+375
-473
lines changed

15 files changed

+375
-473
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ default = [
138138
"bevy_gizmos",
139139
"bevy_gltf",
140140
"bevy_input_focus",
141+
"bevy_log",
141142
"bevy_mesh_picking_backend",
142143
"bevy_pbr",
143144
"bevy_picking",
@@ -159,7 +160,6 @@ default = [
159160
"smaa_luts",
160161
"sysinfo_plugin",
161162
"tonemapping_luts",
162-
"tracing",
163163
"vorbis",
164164
"webgl2",
165165
"x11",
@@ -285,6 +285,9 @@ bevy_dev_tools = ["bevy_internal/bevy_dev_tools"]
285285
# Enable the Bevy Remote Protocol
286286
bevy_remote = ["bevy_internal/bevy_remote"]
287287

288+
# Enable integration with `tracing` and `log`
289+
bevy_log = ["bevy_internal/bevy_log"]
290+
288291
# Enable input focus subsystem
289292
bevy_input_focus = ["bevy_internal/bevy_input_focus"]
290293

@@ -311,10 +314,7 @@ trace_tracy_memory = [
311314
]
312315

313316
# Tracing support
314-
tracing = ["bevy_internal/tracing", "dep:tracing"]
315-
316-
# Enables traces within Bevy using tracing
317-
trace = ["bevy_internal/trace", "tracing"]
317+
trace = ["bevy_internal/trace", "dep:tracing"]
318318

319319
# Basis Universal compressed texture support
320320
basis-universal = ["bevy_internal/basis-universal"]
@@ -1592,7 +1592,7 @@ wasm = true
15921592
name = "headless"
15931593
path = "examples/app/headless.rs"
15941594
doc-scrape-examples = true
1595-
required-features = []
1595+
required-features = ["bevy_log"]
15961596

15971597
[package.metadata.example.headless]
15981598
name = "Headless"

crates/bevy_animation/Cargo.toml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,6 @@ tracing = { version = "0.1", default-features = false, features = ["std"] }
4747
[target.'cfg(target_arch = "wasm32")'.dependencies]
4848
# TODO: Assuming all wasm builds are for the browser. Require `no_std` support to break assumption.
4949
uuid = { version = "1.13.1", default-features = false, features = ["js"] }
50-
bevy_log = { path = "../bevy_log", version = "0.16.0-dev", default-features = false, features = [
51-
"web",
52-
] }
53-
bevy_app = { path = "../bevy_app", version = "0.16.0-dev", default-features = false, features = [
54-
"web",
55-
] }
56-
bevy_platform_support = { path = "../bevy_platform_support", version = "0.16.0-dev", default-features = false, features = [
57-
"web",
58-
] }
59-
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-dev", default-features = false, features = [
60-
"web",
61-
] }
6250

6351
[lints]
6452
workspace = true

crates/bevy_gltf/Cargo.toml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,6 @@ serde_json = "1"
6565
smallvec = "1.11"
6666
tracing = { version = "0.1", default-features = false, features = ["std"] }
6767

68-
[target.'cfg(target_arch = "wasm32")'.dependencies]
69-
# TODO: Assuming all wasm builds are for the browser. Require `no_std` support to break assumption.
70-
bevy_log = { path = "../bevy_log", version = "0.16.0-dev", default-features = false, features = [
71-
"web",
72-
] }
73-
bevy_app = { path = "../bevy_app", version = "0.16.0-dev", default-features = false, features = [
74-
"web",
75-
] }
76-
bevy_platform_support = { path = "../bevy_platform_support", version = "0.16.0-dev", default-features = false, features = [
77-
"web",
78-
] }
79-
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-dev", default-features = false, features = [
80-
"web",
81-
] }
82-
bevy_tasks = { path = "../bevy_tasks", version = "0.16.0-dev", default-features = false, features = [
83-
"web",
84-
] }
85-
8668
[dev-dependencies]
8769
bevy_log = { path = "../bevy_log", version = "0.16.0-dev" }
8870

crates/bevy_internal/Cargo.toml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
1010
categories = ["game-engines", "graphics", "gui", "rendering"]
1111

1212
[features]
13-
tracing = ["bevy_log/tracing"]
1413
trace = [
15-
"tracing",
1614
"bevy_app/trace",
1715
"bevy_asset?/trace",
1816
"bevy_core_pipeline?/trace",
@@ -23,18 +21,10 @@ trace = [
2321
"bevy_render?/trace",
2422
"bevy_winit?/trace",
2523
]
26-
trace_chrome = ["tracing", "bevy_log/tracing-chrome"]
27-
trace_tracy = [
28-
"tracing",
29-
"bevy_render?/tracing-tracy",
30-
"bevy_log/tracing-tracy",
31-
]
32-
trace_tracy_memory = ["tracing", "bevy_log/trace_tracy_memory"]
33-
detailed_trace = [
34-
"tracing",
35-
"bevy_ecs/detailed_trace",
36-
"bevy_render?/detailed_trace",
37-
]
24+
trace_chrome = ["bevy_log/tracing-chrome"]
25+
trace_tracy = ["bevy_render?/tracing-tracy", "bevy_log/tracing-tracy"]
26+
trace_tracy_memory = ["bevy_log/trace_tracy_memory"]
27+
detailed_trace = ["bevy_ecs/detailed_trace", "bevy_render?/detailed_trace"]
3828

3929
sysinfo_plugin = ["bevy_diagnostic/sysinfo_plugin"]
4030

@@ -303,7 +293,6 @@ std = [
303293
"bevy_ecs/std",
304294
"bevy_input/std",
305295
"bevy_input_focus?/std",
306-
"bevy_log/std",
307296
"bevy_math/std",
308297
"bevy_platform_support/std",
309298
"bevy_reflect/std",
@@ -355,7 +344,6 @@ async_executor = [
355344
# Note this is currently only applicable on `wasm32` architectures.
356345
web = [
357346
"bevy_app/web",
358-
"bevy_log/web",
359347
"bevy_platform_support/web",
360348
"bevy_reflect/web",
361349
"bevy_tasks/web",
@@ -397,7 +385,8 @@ bevy_utils = { path = "../bevy_utils", version = "0.16.0-dev", default-features
397385
] }
398386
bevy_tasks = { path = "../bevy_tasks", version = "0.16.0-dev", default-features = false }
399387

400-
bevy_log = { path = "../bevy_log", version = "0.16.0-dev", default-features = false }
388+
# bevy (std required)
389+
bevy_log = { path = "../bevy_log", version = "0.16.0-dev", optional = true }
401390

402391
# bevy (optional)
403392
bevy_a11y = { path = "../bevy_a11y", optional = true, version = "0.16.0-dev", features = [

crates/bevy_internal/src/default_plugins.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugin_group! {
44
/// This plugin group will add all the default plugins for a *Bevy* application:
55
pub struct DefaultPlugins {
66
bevy_app:::PanicHandlerPlugin,
7-
#[cfg(feature = "tracing")]
7+
#[cfg(feature = "bevy_log")]
88
bevy_log:::LogPlugin,
99
bevy_app:::TaskPoolPlugin,
1010
bevy_diagnostic:::FrameCountPlugin,

crates/bevy_internal/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub use bevy_image as image;
4444
pub use bevy_input as input;
4545
#[cfg(feature = "bevy_input_focus")]
4646
pub use bevy_input_focus as input_focus;
47+
#[cfg(feature = "bevy_log")]
4748
pub use bevy_log as log;
4849
pub use bevy_math as math;
4950
#[cfg(feature = "bevy_pbr")]

crates/bevy_internal/src/prelude.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#[doc(hidden)]
22
pub use crate::{
3-
app::prelude::*, ecs::prelude::*, input::prelude::*, log::prelude::*, math::prelude::*,
3+
app::prelude::*, ecs::prelude::*, input::prelude::*, math::prelude::*,
44
platform_support::prelude::*, reflect::prelude::*, time::prelude::*, transform::prelude::*,
55
utils::prelude::*, DefaultPlugins, MinimalPlugins,
66
};
77

8+
#[doc(hidden)]
9+
#[cfg(feature = "bevy_log")]
10+
pub use crate::log::prelude::*;
11+
812
#[doc(hidden)]
913
#[cfg(feature = "bevy_window")]
1014
pub use crate::window::prelude::*;

crates/bevy_log/Cargo.toml

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,24 @@ license = "MIT OR Apache-2.0"
99
keywords = ["bevy"]
1010

1111
[features]
12-
default = ["std", "tracing"]
13-
14-
tracing = ["dep:tracing", "dep:tracing-subscriber", "dep:tracing-log"]
15-
trace = ["tracing", "tracing-error"]
16-
trace_tracy_memory = ["tracing", "dep:tracy-client"]
17-
tracing-chrome = ["tracing", "dep:tracing-chrome"]
18-
tracing-error = ["tracing", "dep:tracing-error"]
19-
tracing-tracy = ["tracing", "dep:tracing-tracy"]
20-
21-
# Allows access to the `std` crate. Enabling this feature will prevent compilation
22-
# on `no_std` targets, but provides access to certain additional features on
23-
# supported platforms.
24-
std = ["bevy_app/std", "bevy_utils/std", "bevy_ecs/std"]
25-
26-
# Enables use of browser APIs.
27-
# Note this is currently only applicable on `wasm32` architectures.
28-
web = ["bevy_app/web", "dep:tracing-wasm"]
12+
trace = ["tracing-error"]
13+
trace_tracy_memory = ["dep:tracy-client"]
2914

3015
[dependencies]
3116
# bevy
32-
bevy_app = { path = "../bevy_app", version = "0.16.0-dev", default-features = false }
33-
bevy_utils = { path = "../bevy_utils", version = "0.16.0-dev", default-features = false, features = [
34-
"alloc",
35-
] }
36-
bevy_ecs = { path = "../bevy_ecs", version = "0.16.0-dev", default-features = false }
17+
bevy_app = { path = "../bevy_app", version = "0.16.0-dev" }
18+
bevy_utils = { path = "../bevy_utils", version = "0.16.0-dev" }
19+
bevy_ecs = { path = "../bevy_ecs", version = "0.16.0-dev" }
3720

3821
# other
39-
log = { version = "0.4", default-features = false }
40-
tracing-subscriber = { version = "0.3.1", optional = true, features = [
22+
tracing-subscriber = { version = "0.3.1", features = [
4123
"registry",
4224
"env-filter",
4325
] }
4426
tracing-chrome = { version = "0.7.0", optional = true }
45-
tracing-log = { version = "0.2.0", optional = true }
27+
tracing-log = "0.2.0"
4628
tracing-error = { version = "0.2.0", optional = true }
47-
tracing = { version = "0.1", default-features = false, optional = true, features = [
48-
"std",
49-
] }
29+
tracing = { version = "0.1", default-features = false, features = ["std"] }
5030

5131
# Tracy dependency compatibility table:
5232
# https://github.com/nagisa/rust_tracy_client
@@ -57,7 +37,11 @@ tracy-client = { version = "0.18.0", optional = true }
5737
android_log-sys = "0.3.0"
5838

5939
[target.'cfg(target_arch = "wasm32")'.dependencies]
60-
tracing-wasm = { version = "0.2.1", optional = true }
40+
tracing-wasm = "0.2.1"
41+
# TODO: Assuming all wasm builds are for the browser. Require `no_std` support to break assumption.
42+
bevy_app = { path = "../bevy_app", version = "0.16.0-dev", default-features = false, features = [
43+
"web",
44+
] }
6145

6246
[target.'cfg(target_os = "ios")'.dependencies]
6347
tracing-oslog = "0.2"

crates/bevy_log/src/android_tracing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use alloc::{ffi::CString, format, string::String, vec::Vec};
1+
use alloc::ffi::CString;
22
use core::fmt::{Debug, Write};
33
use tracing::{
44
field::Field,

0 commit comments

Comments
 (0)