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
@hymm hymm added this to the 0.18 milestone Dec 7, 2025
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 7, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 7, 2025
Merged via the queue into bevyengine:main with commit 008ca5d Dec 7, 2025
51 checks passed
@kpreid kpreid deleted the getrandom branch January 5, 2026 20:42
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-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it 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

5 participants