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

Add portable-atomic support to bevy_utils for once! #17027

Merged

Conversation

bushrat011899
Copy link
Contributor

Objective

  • Improves platform compatibility for bevy_utils

Solution

  • Added portable-atomic to allow using the once! macro on more platforms (e.g., Raspberry Pi Pico)

Testing

  • CI

Notes

  • This change should be entirely hidden thanks to the use of doc(hidden). Enabling the new portable-atomic feature just allows using the once! macro on platforms which previously could not.
  • I took the liberty of updating the feature documentation to be more in line with how I've documented features in bevy_ecs/bevy_app/etc. for their no_std updates.

@bushrat011899 bushrat011899 added C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy A-Utils Utility functions and types X-Uncontroversial This work is generally agreed upon S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Dec 29, 2024
@alice-i-cecile alice-i-cecile added D-Straightforward Simple bug fixes and API improvements, docs, test and examples and removed D-Trivial Nice and easy! A great choice to get started with Bevy labels Dec 29, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Very nice :) I particularly appreciate the docs on the features.

@BenjaminBrienen
Copy link
Contributor

I think eventually we should have this kind of code live in a bevy_platform_adaptors or whatever.

@bushrat011899
Copy link
Contributor Author

I think eventually we should have this kind of code live in a bevy_platform_adaptors or whatever.

Totally agree, just wanted to sneak this change in as-is to unblock #17028.

@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 Dec 29, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 29, 2024
Merged via the queue into bevyengine:main with commit c8110f5 Dec 29, 2024
33 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Dec 29, 2024
# Objective

- Contributes to #15460

## Solution

- Added the following features:
  - `std` (default)
  - `portable-atomic`
  - `critical-section`

## Testing

- CI

## Notes

- `portable-atomic`, and `critical-section` are shortcuts to enable the
relevant features in dependencies, making the usage of this crate on
atomically challenged platforms possible and simpler.
- This PR is blocked until #17027 is merged (as it depends on fixes for
the `once!` macro). Once merged, the change-count for this PR should
reduce.
ecoskey pushed a commit to ecoskey/bevy that referenced this pull request Jan 6, 2025
…#17027)

# Objective

- Improves platform compatibility for `bevy_utils`

## Solution

- Added `portable-atomic` to allow using the `once!` macro on more
platforms (e.g., Raspberry Pi Pico)

## Testing

- CI

## Notes

- This change should be entirely hidden thanks to the use of
`doc(hidden)`. Enabling the new `portable-atomic` feature just allows
using the `once!` macro on platforms which previously could not.
- I took the liberty of updating the feature documentation to be more in
line with how I've documented features in `bevy_ecs`/`bevy_app`/etc. for
their `no_std` updates.
ecoskey pushed a commit to ecoskey/bevy that referenced this pull request Jan 6, 2025
# Objective

- Contributes to bevyengine#15460

## Solution

- Added the following features:
  - `std` (default)
  - `portable-atomic`
  - `critical-section`

## Testing

- CI

## Notes

- `portable-atomic`, and `critical-section` are shortcuts to enable the
relevant features in dependencies, making the usage of this crate on
atomically challenged platforms possible and simpler.
- This PR is blocked until bevyengine#17027 is merged (as it depends on fixes for
the `once!` macro). Once merged, the change-count for this PR should
reduce.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Utils Utility functions and types C-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples 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.

3 participants