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
@dloukadakis dloukadakis added D-Trivial Nice and easy! A great choice to get started with Bevy C-Dependencies A change to the crates that Bevy depends on X-Uncontroversial This work is generally agreed upon S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Dependencies A change to the crates that Bevy depends on D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bevy_platform depends on getrandom but doesn't need to

2 participants