Skip to content
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

Improve bevy_reflect no_std support #18060

Merged

Conversation

bushrat011899
Copy link
Contributor

@bushrat011899 bushrat011899 commented Feb 26, 2025

Objective

Solution

  • Switched function registry to use bevy_platform_support::sync instead of std::sync
  • Also documented that debug_stack (and transitively debug) require std
  • Also removed std from wgpu-types since that crate is now no_std compatible

Testing

  • cargo check -p bevy_reflect --no-default-features --features critical-section,documentation,glam,glam/libm,smallvec,wgpu-types,functions --target thumbv6m-none-eabi

Notes

With these changes, bevy_reflect's feature support looks like this:

Feature no_std (Before) no_std (After) Notes
default
std
documentation ✔️ ✔️
functions ✔️
critical-section ✔️ ✔️
bevy ✔️* ✔️* Partial due to smol_str
debug
debug_stack
petgraph
glam ✔️* ✔️* Requires enabling glam/libm
smallvec ✔️ ✔️
uuid ✔️* ✔️* Requires setting up getrandom backend
wgpu-types ✔️
smol_str ✔️* ✔️* Partial due to smol_str not supporting portable-atomic

@bushrat011899 bushrat011899 added C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy A-Reflection Runtime information about types X-Uncontroversial This work is generally agreed upon S-Needs-Review Needs reviewer attention (from anyone!) to move forward O-Embedded Weird hardware and no_std platforms labels Feb 26, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Feb 26, 2025
Copy link

@shekohex shekohex left a comment

Choose a reason for hiding this comment

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

It works! Thank you for the quick fix!

@bushrat011899 bushrat011899 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 Feb 26, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 27, 2025
Merged via the queue into bevyengine:main with commit ad016cb Feb 27, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy O-Embedded Weird hardware and no_std platforms 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_reflect: no no_std support when the functions feature is enabled
5 participants