You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ uname -a
Linux [hostname removed] 6.1.29-hardened1 #1-NixOS SMP PREEMPT_DYNAMIC Wed May 17 09:54:00 UTC 2023 x86_64 GNU/Linux
Crates
tracing-subscriber
Description
If I add tracing-subscriber, with the crate feature fmt enabled, to the dependencies of a crate using Rust 1.58.1 and try to build the crate, the build fails:
Compiling thread_local v1.1.7
error[E0658]: use of unstable library feature 'thread_local_const_init'
--> [path removed]/.cargo/registry/src/github.com-1ecc6299db9ec823/thread_local-1.1.7/src/thread_id.rs:132:9
|
132 | thread_local! { static THREAD: Cell<Option<Thread>> = const { Cell::new(None) }; }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #84223 <https://github.com/rust-lang/rust/issues/84223> for more information
= note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0658`.
error: could not compile `thread_local` due to previous error
If I remove tracing-subscriber from the dependencies and rebuild, the build succeeds.
According to #2003 (comment), this thread_local_const_init feature "requires Rust 1.59", whereas tracing-subscriber documents its minimum supported Rust version (MSRV) as 1.56:
thread_local = { version = "1.1.4", optional = true }
According to Lib.rs, thread_local 1.1.4 had MSRV 1.36, whereas thread_local's latest release, 1.1.7, has MSRV 1.59. According to Lib.rs, thread_local versions 1.1.5 and 1.1.6 are yanked. I suppose I could force Cargo to use version 1.1.4; while the later versions include some bug fixes, these appear to be only for bugs that were not in 1.1.4. Indeed, if I run cargo update -p thread_local --precise 1.1.4, the build then succeeds.
I see that tracing-subscriber would not depend on thread_local at all if I were to use only the default crate features and not the fmt feature.
Conclusions
If you take the position that the MSRV applies only to the default crate features, then tracing-subscriber's (or the main tracing crate's) MSRV documentation could say so explicitly.
If you take the position that the adjective "supported" in "minimum supported Rust version" means that it must be possible for users on the MSRV to construct a Cargo.lock that allows them to build successfully, then tracing-subscriber's MSRV documentation could mention that users with Rust older than 1.59 must override the version of thread_local to 1.1.4, such as by running cargo update -p thread_local --precise 1.1.4.
The text was updated successfully, but these errors were encountered:
Bug Report
Version
With
tracing-subscriber
:Without
tracing-subscriber
:Platform
Crates
tracing-subscriber
Description
If I add
tracing-subscriber
, with the crate featurefmt
enabled, to the dependencies of a crate using Rust 1.58.1 and try to build the crate, the build fails:If I remove
tracing-subscriber
from the dependencies and rebuild, the build succeeds.According to #2003 (comment), this
thread_local_const_init
feature "requires Rust 1.59", whereastracing-subscriber
documents its minimum supported Rust version (MSRV) as 1.56:tracing/tracing-subscriber/src/lib.rs
Lines 106 to 110 in 2906278
I see that
tracing-subscriber
depends onthread_local
^1.1.4:tracing/tracing-subscriber/Cargo.toml
Line 64 in 2906278
According to Lib.rs,
thread_local
1.1.4 had MSRV 1.36, whereasthread_local
's latest release, 1.1.7, has MSRV 1.59. According to Lib.rs,thread_local
versions 1.1.5 and 1.1.6 are yanked. I suppose I could force Cargo to use version 1.1.4; while the later versions include some bug fixes, these appear to be only for bugs that were not in 1.1.4. Indeed, if I runcargo update -p thread_local --precise 1.1.4
, the build then succeeds.I see that
tracing-subscriber
would not depend onthread_local
at all if I were to use only the default crate features and not thefmt
feature.Conclusions
If you take the position that the MSRV applies only to the default crate features, then
tracing-subscriber
's (or the maintracing
crate's) MSRV documentation could say so explicitly.If you take the position that the adjective "supported" in "minimum supported Rust version" means that it must be possible for users on the MSRV to construct a
Cargo.lock
that allows them to build successfully, thentracing-subscriber
's MSRV documentation could mention that users with Rust older than 1.59 must override the version ofthread_local
to 1.1.4, such as by runningcargo update -p thread_local --precise 1.1.4
.The text was updated successfully, but these errors were encountered: