Skip to content

tracing: add portable-atomic support to other tracing crates #3246

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

Merged
merged 2 commits into from
Apr 10, 2025

Conversation

bushrat011899
Copy link

This PR expands portable-atomic utilisation within Tracing, improving platform support without breaking the existing public API.

Motivation

Since #3199 was merged, it's now possible to bring more tracing crates to atomically challenged platforms through portable-atomic. Additionally, CI is not currently setup to ensure this feature behaves as expected (allowing compilation on platforms with incomplete atomic support).

Solution

  • Added portable-atomic support to:
    • tracing
    • tracing-futures
    • tracing-serde
    • tracing-subscriber
  • Added no_std support to:
    • tracing-macros
    • tracing-futures
  • Added CI task to catch regressions in portable-atomic and no_std support.

Notes

  • A critical-section feature is also added to make CI testing and usage of tracing/etc. on atomically challenged platforms simpler.
  • No additional dependencies are included in this PR, optional or otherwise. Instances of including portable-atomic as a dependency only occur when it would have already been included transitively via tracing-core's portable-atomic-util dependency.
  • I checked all instances of replacing core::sync::atomic with portable-atomic to ensure the public API was unaffected. As such, this is not a breaking change, since it simply adds portable-atomic and critical-section features.

Added `portable-atomic` support to:
- `tracing`
- `tracing-futures`
- `tracing-serde`
- `tracing-subscriber`

Added `no_std` support to:
- `tracing-macros`
- `tracing-futures`

Added CI task to catch regressions in `portable-atomic` _and_ `no_std` support.
Copy link
Contributor

@hds hds left a comment

Choose a reason for hiding this comment

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

This looks good. Thank you very much for your work on portable atomics!

@hds hds merged commit 8941592 into tokio-rs:master Apr 10, 2025
56 checks passed
@hds hds changed the title tracing: Add portable-atomic support to other tracing crates tracing: add portable-atomic support to other tracing crates Apr 10, 2025
@hds hds mentioned this pull request May 21, 2025
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants