Skip to content

Commit dc48fd4

Browse files
cartmockersf
authored andcommitted
Revert "Allow partial support for bevy_log in no_std (#18782)" (#18816)
This reverts commit ac52cca. Fixes #18815 the interest of providing no_std support, specifically no_atomic support). That tradeoff isn't worth it, especially given that tracing is likely to get no_atomic support. Revert #18782
1 parent f006f02 commit dc48fd4

File tree

15 files changed

+377
-475
lines changed

15 files changed

+377
-475
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ default = [
137137
"bevy_gizmos",
138138
"bevy_gltf",
139139
"bevy_input_focus",
140+
"bevy_log",
140141
"bevy_mesh_picking_backend",
141142
"bevy_pbr",
142143
"bevy_picking",
@@ -158,7 +159,6 @@ default = [
158159
"smaa_luts",
159160
"sysinfo_plugin",
160161
"tonemapping_luts",
161-
"tracing",
162162
"vorbis",
163163
"webgl2",
164164
"x11",
@@ -274,6 +274,9 @@ bevy_dev_tools = ["bevy_internal/bevy_dev_tools"]
274274
# Enable the Bevy Remote Protocol
275275
bevy_remote = ["bevy_internal/bevy_remote"]
276276

277+
# Enable integration with `tracing` and `log`
278+
bevy_log = ["bevy_internal/bevy_log"]
279+
277280
# Enable input focus subsystem
278281
bevy_input_focus = ["bevy_internal/bevy_input_focus"]
279282

@@ -300,10 +303,7 @@ trace_tracy_memory = [
300303
]
301304

302305
# Tracing support
303-
tracing = ["bevy_internal/tracing", "dep:tracing"]
304-
305-
# Enables traces within Bevy using tracing
306-
trace = ["bevy_internal/trace", "tracing"]
306+
trace = ["bevy_internal/trace", "dep:tracing"]
307307

308308
# Basis Universal compressed texture support
309309
basis-universal = ["bevy_internal/basis-universal"]
@@ -1581,7 +1581,7 @@ wasm = true
15811581
name = "headless"
15821582
path = "examples/app/headless.rs"
15831583
doc-scrape-examples = true
1584-
required-features = []
1584+
required-features = ["bevy_log"]
15851585

15861586
[package.metadata.example.headless]
15871587
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-rc.4", default-features = false, features = [
51-
"web",
52-
] }
53-
bevy_app = { path = "../bevy_app", version = "0.16.0-rc.4", default-features = false, features = [
54-
"web",
55-
] }
56-
bevy_platform = { path = "../bevy_platform", version = "0.16.0-rc.4", default-features = false, features = [
57-
"web",
58-
] }
59-
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-rc.4", 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
@@ -66,24 +66,6 @@ serde_json = "1"
6666
smallvec = "1.11"
6767
tracing = { version = "0.1", default-features = false, features = ["std"] }
6868

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

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",
@@ -22,18 +20,10 @@ trace = [
2220
"bevy_render?/trace",
2321
"bevy_winit?/trace",
2422
]
25-
trace_chrome = ["tracing", "bevy_log/tracing-chrome"]
26-
trace_tracy = [
27-
"tracing",
28-
"bevy_render?/tracing-tracy",
29-
"bevy_log/tracing-tracy",
30-
]
31-
trace_tracy_memory = ["tracing", "bevy_log/trace_tracy_memory"]
32-
detailed_trace = [
33-
"tracing",
34-
"bevy_ecs/detailed_trace",
35-
"bevy_render?/detailed_trace",
36-
]
23+
trace_chrome = ["bevy_log/tracing-chrome"]
24+
trace_tracy = ["bevy_render?/tracing-tracy", "bevy_log/tracing-tracy"]
25+
trace_tracy_memory = ["bevy_log/trace_tracy_memory"]
26+
detailed_trace = ["bevy_ecs/detailed_trace", "bevy_render?/detailed_trace"]
3727

3828
sysinfo_plugin = ["bevy_diagnostic/sysinfo_plugin"]
3929

@@ -304,7 +294,6 @@ std = [
304294
"bevy_ecs/std",
305295
"bevy_input/std",
306296
"bevy_input_focus?/std",
307-
"bevy_log/std",
308297
"bevy_math/std",
309298
"bevy_platform/std",
310299
"bevy_reflect/std",
@@ -356,7 +345,6 @@ async_executor = [
356345
# Note this is currently only applicable on `wasm32` architectures.
357346
web = [
358347
"bevy_app/web",
359-
"bevy_log/web",
360348
"bevy_platform/web",
361349
"bevy_reflect/web",
362350
"bevy_tasks/web",
@@ -398,7 +386,8 @@ bevy_utils = { path = "../bevy_utils", version = "0.16.0-rc.4", default-features
398386
] }
399387
bevy_tasks = { path = "../bevy_tasks", version = "0.16.0-rc.4", default-features = false }
400388

401-
bevy_log = { path = "../bevy_log", version = "0.16.0-rc.4", default-features = false }
389+
# bevy (std required)
390+
bevy_log = { path = "../bevy_log", version = "0.16.0-rc.4", optional = true }
402391

403392
# bevy (optional)
404393
bevy_a11y = { path = "../bevy_a11y", optional = true, version = "0.16.0-rc.4", 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
@@ -42,6 +42,7 @@ pub use bevy_image as image;
4242
pub use bevy_input as input;
4343
#[cfg(feature = "bevy_input_focus")]
4444
pub use bevy_input_focus as input_focus;
45+
#[cfg(feature = "bevy_log")]
4546
pub use bevy_log as log;
4647
pub use bevy_math as math;
4748
#[cfg(feature = "bevy_pbr")]

crates/bevy_internal/src/prelude.rs

Lines changed: 7 additions & 3 deletions
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::*,
4-
platform::prelude::*, reflect::prelude::*, time::prelude::*, transform::prelude::*,
5-
utils::prelude::*, DefaultPlugins, MinimalPlugins,
3+
app::prelude::*, ecs::prelude::*, input::prelude::*, math::prelude::*, platform::prelude::*,
4+
reflect::prelude::*, time::prelude::*, transform::prelude::*, utils::prelude::*,
5+
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-rc.4", default-features = false }
33-
bevy_utils = { path = "../bevy_utils", version = "0.16.0-rc.4", default-features = false, features = [
34-
"alloc",
35-
] }
36-
bevy_ecs = { path = "../bevy_ecs", version = "0.16.0-rc.4", default-features = false }
17+
bevy_app = { path = "../bevy_app", version = "0.16.0-rc.4" }
18+
bevy_utils = { path = "../bevy_utils", version = "0.16.0-rc.4" }
19+
bevy_ecs = { path = "../bevy_ecs", version = "0.16.0-rc.4" }
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)