Skip to content

Commit 008ca5d

Browse files
authored
Remove getrandom dependency from bevy_platform. (#21971)
# Objective Fixes #21336. `bevy_platform` and dependents such as `bevy_ecs` may be used on web without incurring the `RUSTFLAGS` requirement of `getrandom`. ## Solution Remove dependency `bevy_platform` → `getrandom`. Note: There was a suggestion of adding a dependency `bevy_math` → `getrandom` to replace it, but `bevy_math` does not actually depend transitively on `getrandom` at all (except in its examples), nor does any other Bevy library. If making `getrandom` work is desired for convenience of Bevy users, we could add `bevy_internal/web` → `getrandom/wasm_js`, but that would not be for the use of Bevy itself at all, and it would mean that Bevy users would hit the `RUSTFLAGS` requirement even if they don't truly need it. ## Testing - Ran `cargo run -p ci -- compile` and `cargo run -p ci -- test`. - Tested depending on this version of `bevy_ecs` in my own wasm32 project. - Have not tested any further feature combinations.
1 parent dba7c74 commit 008ca5d

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

crates/bevy_platform/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ critical-section = ["dep:critical-section", "portable-atomic/critical-section"]
5050
web = [
5151
"std",
5252
"dep:web-time",
53-
"dep:getrandom",
5453
"dep:wasm-bindgen-futures",
5554
"dep:wasm-bindgen",
5655
"dep:js-sys",
@@ -76,9 +75,6 @@ rayon = { version = "1", default-features = false, optional = true }
7675

7776
[target.'cfg(target_arch = "wasm32")'.dependencies]
7877
web-time = { version = "1.1", default-features = false, optional = true }
79-
getrandom = { version = "0.3.0", default-features = false, optional = true, features = [
80-
"wasm_js",
81-
] }
8278
wasm-bindgen-futures = { version = "0.4", default-features = false, optional = true }
8379
futures-channel = { version = "0.3", default-features = false }
8480
js-sys = { version = "0.3", default-features = false, optional = true }

0 commit comments

Comments
 (0)