tokio-rs / tracing

Application level tracing for Rust.
https://tracing.rs
MIT License
5.15k stars 673 forks source link

Remove once_cell as a dependency #2949

Open james7132 opened 2 months ago

james7132 commented 2 months ago

Motivation

Decrease the number of dependencies to improve compilation times.

Solution

Replace existing uses of once_cell::sync::Lazy with std::sync::OnceLock, or use const initialization where possible. This bumps the MSRV for a few crates to 1.70, but should keep the baseline MSRV at 1.63.

mladedav commented 2 months ago

Can you please also look into updating thread-local? tracing-subscriber still transitively depends on once_cell because of that.

mladedav commented 2 months ago

Debian Stable is a good MSRV limit, I'd say.

For the record, current Debian stable is bookworm which offers 1.63, which is the current MSRV version.

james7132 commented 2 months ago

For thread-local, https://github.com/Amanieu/thread_local-rs/pull/76 should handle this without pushing past 1.63.

Note that the MSRV policy in the README states last 3 versions of stable Rust, which would put a cap at 1.74, far past 1.63. It does seem like Debian Sid is at 1.70 now, so it's likely it will be used in the next Debian release, but that need to wait until mid-2025 or later before that's available. I can separate out the changes for tracing-flame, tracing-subscriber, and tracing-log into a separate PR if need be.