libtest-mimic icon indicating copy to clipboard operation
libtest-mimic copied to clipboard

Switch from termcolor to anstream, like clap?

Open hanna-kruppe opened this issue 1 year ago • 1 comments

Thanks for libtest-mimic! I have a feature request of sorts. I'd be happy to put in the work to implement it, but since it's not completely trivial and raises a question about MSRV, I wanted to ask how you feel about it before I start on it.

clap switched from using termcolor to anstream for colored text output over a year ago (https://github.com/clap-rs/clap/pull/4765) while libtest-mimic still uses termcolor. This means that any workspace using libtest-mimic and a reasonably recent clap version is pulling in both of those crates and their respective dependencies. This works, but it's a bit silly in principle and the two crates don't 100% agree on which environment variables affect colored output. It's also a bit wasteful to always build two implementation of the same functionality, especially on Windows, where both pull in windows-sys with different sets of features (and potentially two different versions, when windows-sys makes a new semver-breaking release).

So I'd like to switch libtest-mimic to use anstream v0.6, to share dependencies with modern versions of clap. However, anstream and its dependencies currently have a MSRV of 1.64 or 1.65 (not 100% sure, Cargo.toml and the commit that modified it give different versions). libtest-mimic declares 1.60 MSRV in Cargo.toml (though 08e76d3557ea7e4ebfac403574eeb6f5a17f49a4 suggest reality may be more complicated). Perhaps enough time has passed that bumping MSRV to 1.65 is alright?

hanna-kruppe avatar Jun 08 '24 12:06 hanna-kruppe

Your request sounds very reasonable and I'm totally fine with bumping the MSRV :) Will probably do a major version bump, but that's not a problem. If you'd prepare a PR for this, that'd be great.

LukasKalbertodt avatar Jun 28 '24 08:06 LukasKalbertodt