Add no_std support to bevy_log #20539
Draft
+120 −41
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Objective
bevy_loginno_std#18782, which was reverted in Revert "Allow partial support forbevy_loginno_std(#18782)" #18816. This time with properno_stdsupport.@bushrat011899's work on adding portable-atomic support was merged. I saw that this was backported in tokio-rs/tracing#3283 and started working on the PR. Then I realized the release hadn’t been drafted yet: tokio-rs/tracing#3282 😢
Keeping this PR as a draft for now - it only requires uncommenting 2 lines once the release drops (see the
TODOinbevy_log's Cargo.toml).Solution
std,web, andcritical-sectiontobevy_log.portable-atomicinbevy_log, similar to other crates.bevy_lognon-optional. It became optional after theno_stdmigration (Addno_stdsupport tobevy#17955) because it requiredstd. In the original attempt (Allow partial support forbevy_loginno_std#18782), it was also made non-optional.Testing
Migration Guide
bevy_logwith default features disabled, enable the newstdfeature.bevy_logfeature, remove it.