rust-cli / env_logger

A logging implementation for `log` which is configured via an environment variable.
https://docs.rs/env_logger
Apache License 2.0
782 stars 124 forks source link

MSRV break due to is_terminal 0.4.8 #273

Closed qinsoon closed 1 year ago

qinsoon commented 1 year ago

env_logger 0.10.0 uses is_terminal 0.4.0 and names its MSRV as 1.60, but the new release of is_terminal 0.4.8 increases their MSRV to 1.63 (https://github.com/sunfishcode/is-terminal/blob/f720869b4796297d0c1814fe99a7914bf9391315/Cargo.toml#L16). So env_logger 0.10.0 can only build with Rust 1.63+ at the moment.

epage commented 1 year ago

env_loggers dependency on is_terminal is

is-terminal = { version = "0.4.0", optional = true }

This means env_logger can be used with any version of is-terminal, from 0.4.0 to 0.4.8.

So for users who want the lower end of our MSRV, they can choose older versions of is-terminal to meet their MSRV needs. This will be made easier when rust-lang/cargo#9930 is implemented.

This does require checking in your lockfile. In rust-lang/cargo#8728, I have proposed that the cargo team starts recommending it be checked in, officially. A lot of us are already doing so.

Apparently, there is a common suggestion that packages set an upper bound for what is compatible. rust-lang/cargo#8728 talks a little about why that is bad and in rust-lang/cargo#12323, we are updating cargo's documentation to warn people away from it.