Skip to content
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

Replace is-terminal dep with std::io::IsTerminal #276

Closed
LunNova opened this issue Aug 24, 2023 · 7 comments · Fixed by #298
Closed

Replace is-terminal dep with std::io::IsTerminal #276

LunNova opened this issue Aug 24, 2023 · 7 comments · Fixed by #298
Milestone

Comments

@LunNova
Copy link

LunNova commented Aug 24, 2023

https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html

Needs to wait for MSRV 1.70

@epage
Copy link
Contributor

epage commented Aug 24, 2023

Looks like we don't have a state MSRV policy. My default choice is N-2 but I suspect that env_logger's wider use might make that unappealing.

@matthiasbeyer any thoughts?

@matthiasbeyer
Copy link
Member

Yeah so I would actually keep this crate as backwards compatible as possible within reason. If we currently compile on N-10 or even older, I don't see why we should change that if we do not have some really good reasons.

Rationale is that this is, IMO, the go-to crate for "I want logging". It's the lowest-hanging fruit for getting logging to work in a Rust project, at least in my perception.

I would like to see this issue resolved, but I think backwards compatibility is more important.

I'm open to discussion though.

@LunNova
Copy link
Author

LunNova commented Aug 24, 2023

Might be possible to use cfg(not(version("1.70"))) to use that dep only on old versions and avoid bumping MSRV. Haven't tried, not sure if you can do that in Cargo.toml. definitely not possible, cfg(version) isn't stable

@epage
Copy link
Contributor

epage commented Nov 10, 2023

Another change I'm looking to make, switching from termcolor to anstream, would require an MSRV bump and would lead to a breaking change (removal of the env_logger styling API).

While I'm not a fan of treating MSRV as a breaking change, if its done in conjunction with breakings changes (with a commitment to support old versions if needed), I wonder if that would be sufficient to allow us to move forward with this.

@kayabaNerve
Copy link

You can write a build script such that it sets a feature for either is-terminal or std-io-isterminal based on the version in use. That wouldn't be breaking.

@emilk
Copy link

emilk commented Jan 16, 2024

I'd love to see this too. Getting rid of the is-terminal dependency tree would be lovely:

is-terminal v0.4.7
├── io-lifetimes v1.0.10
│   └── libc v0.2.150
└── rustix v0.37.19
    ├── bitflags v1.3.2
    ├── errno v0.3.1
    │   └── libc v0.2.150
    ├── io-lifetimes v1.0.10 (*)
    └── libc v0.2.150

epage added a commit to epage/env_logger that referenced this issue Jan 18, 2024
@epage
Copy link
Contributor

epage commented Jan 18, 2024

I've gone ahead with my idea of bundling the MSRV bump with a pre-planned breaking change of switching from termcolor to anstream. Longer term, I'm hoping rust-lang/rfcs#3537 will help reduce the conflict between the users who want the latest and those who need an earlier version.

See #298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants