tracing icon indicating copy to clipboard operation
tracing copied to clipboard

Remove once_cell as a dependency

Open james7132 opened this issue 1 year ago • 5 comments

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.

james7132 avatar Apr 23 '24 08:04 james7132

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

mladedav avatar Apr 23 '24 15:04 mladedav

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.

mladedav avatar Apr 23 '24 16:04 mladedav

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.

james7132 avatar Apr 23 '24 16:04 james7132