Skip to content

Update rand, glam and encase to latest versions #18047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Bluefinger
Copy link
Contributor

@Bluefinger Bluefinger commented Feb 26, 2025

Objective

New rand version, which means updating glam and encase to support the newer ecosystem update. Does mean that this changes how WASM builds need to be done in order to configure getrandom correctly, but this can be remedied with updated docs.

Solution

Updating all needed dependencies to their compatible versions. This PR is currently blocked by encase, which is waiting on this PR to be merged and then a new version published. This PR is no longer blocked, hexasphere is blocking this PR now due to not yet having a new release with the latest glam version support.

Testing

  • Must pass CI for all checks, tests, not introduce breaking changes.

Migration Guide

With newer versions of glam & encase, the updated versions don't seem to have introduced breakages, though as always, best to consult their docs 1 2 for any changes.

rand changes are more extensive, with changes such as thread_rng() -> rng(), from_entropy() -> from_os_rng(), and so forth. RngCore is now split into infallible RngCore and fallible TryRngCore, and the distributions module has been renamed to distr. Most of this affects only internals, and doesn't directly affect Bevy's APIs. For the full set of changes, see rand migration notes.

getrandom is also updated, and will require additional configuration when building Bevy for WASM/Web (if also using rand). The full details of how to do this is in the getrandom docs 1 2.

@mnmaita mnmaita added C-Dependencies A change to the crates that Bevy depends on S-Blocked This cannot move forward until something else changes D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 26, 2025
@alice-i-cecile alice-i-cecile added the A-Math Fundamental domain-agnostic mathematical operations label Feb 26, 2025
Copy link
Contributor

@mrchantey mrchantey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, lots of files changed but as mentioned in the pr its a 1:1 mapping to the updated function naming convention. I'm sure the wasm rustflags will be a gotcha for many a rust newbie, it'll be helful for us to explain this as much as possible in docs and guides.

@Bluefinger Bluefinger force-pushed the rand-v0.9-upgrade branch from 02c1ca9 to 6b8bb28 Compare May 9, 2025 08:34
@Bluefinger Bluefinger marked this pull request as ready for review May 9, 2025 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Dependencies A change to the crates that Bevy depends on D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Blocked This cannot move forward until something else changes S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants