Skip to content

Tracking Issue: no_std for bevy_asset #18978

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
9 tasks
bushrat011899 opened this issue Apr 29, 2025 · 1 comment
Open
9 tasks

Tracking Issue: no_std for bevy_asset #18978

bushrat011899 opened this issue Apr 29, 2025 · 1 comment
Assignees
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Feature A new feature, making something new possible D-Complex Quite challenging from either a design or technical perspective. Ask for help! O-Embedded Weird hardware and no_std platforms S-Needs-Design This issue requires design work to think about how it would best be accomplished

Comments

@bushrat011899
Copy link
Contributor

bushrat011899 commented Apr 29, 2025

Motivation

bevy_asset is a key crate within Bevy that makes heavy usage of std, making it challenging to add no_std support to. This is a tracking issue to document what I anticipate will be a lengthy process.

End Goal

  • To support some subset of bevy_asset on no_std targets, such as wasm32v1-none

Tasks

Below are some particular tasks which will need to be accomplished prior to no_std support. They are in no particular order.

  • Remove or make optional parking_lot
  • Add no_std support to ron
  • Handle the following incompatible dependencies:
    • async-broadcast
    • async-fs
    • crossbeam-channel
    • futures-io
  • Make AssetPath independent of std::path::Path (Cart has previously expressed that AssetPath should always be valid UTF-8 and only use / as its path separator, implying str is a suitable backend)
  • Make bevy_asset independent of std::io::Error.
  • Feature-gate built-in filesystem IO support (std::fs)
@bushrat011899 bushrat011899 added A-Assets Load files from disk to use for things like images, models, and sounds C-Feature A new feature, making something new possible D-Complex Quite challenging from either a design or technical perspective. Ask for help! O-Embedded Weird hardware and no_std platforms S-Needs-Design This issue requires design work to think about how it would best be accomplished labels Apr 29, 2025
@bushrat011899 bushrat011899 self-assigned this Apr 29, 2025
github-merge-queue bot pushed a commit that referenced this issue May 5, 2025
# Objective

- Contributes to #18978

## Solution

- Disable default features on all dependencies in `bevy_asset` and
explicitly enable ones that are required.
- Remove `compile_error` caused by enabling `file_watcher` without
`multi_threaded` by including `multi_threaded` in `file_watcher`.

## Testing

- CI

---

## Notes

No breaking changes here, just a little cleaning before the more
controversial changes for `no_std` support.

---------

Co-authored-by: François Mockers <[email protected]>
@bushrat011899
Copy link
Contributor Author

Can potentially use a technique similar to ciborium-io to provide an intermediary between std::io and bevy_asset::io which adds no_std support. The question becomes whether:

  1. Use ciborium-io itself
  2. Add a custom alternative to bevy_platform that is as-close-as-possible to std::io
  3. Flesh out AssetReader, AssetWriter, Reader, Writer, etc. in bevy_asset and apply the technique at that higher level

Since bevy_asset requires std::io and futures_io to fully define its IO traits, we'd need to do this across a fairly wide API surface area (I estimate a couple thousand LOC plus tests). Definitely needs consideration before choosing a path.

andrewzhurov pushed a commit to andrewzhurov/bevy that referenced this issue May 17, 2025
# Objective

- Contributes to bevyengine#18978

## Solution

- Disable default features on all dependencies in `bevy_asset` and
explicitly enable ones that are required.
- Remove `compile_error` caused by enabling `file_watcher` without
`multi_threaded` by including `multi_threaded` in `file_watcher`.

## Testing

- CI

---

## Notes

No breaking changes here, just a little cleaning before the more
controversial changes for `no_std` support.

---------

Co-authored-by: François Mockers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Feature A new feature, making something new possible D-Complex Quite challenging from either a design or technical perspective. Ask for help! O-Embedded Weird hardware and no_std platforms S-Needs-Design This issue requires design work to think about how it would best be accomplished
Projects
None yet
Development

No branches or pull requests

1 participant