Skip to content

Conversation

@kpreid
Copy link
Contributor

@kpreid kpreid commented Nov 28, 2025

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_platformgetrandom.

Note: There was a suggestion of adding a dependency bevy_mathgetrandom 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/webgetrandom/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.

Fixes <bevyengine#21336>,
allowing `bevy_platform` and dependents such as `bevy_ecs` to be used on
web without incurring the `RUSTFLAGS` requirement of `getrandom`.
@kpreid kpreid changed the title Remove getrandom/wasm_js dependency from bevy_platform. Remove getrandom dependency from bevy_platform. Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bevy_platform depends on getrandom but doesn't need to

1 participant