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

Workaround cargo bug with enable features of optional dependencies #304

Closed sdroege closed 5 months ago

sdroege commented 5 months ago

While this works fine with Rust 1.73+, it does not work with Rust 1.70 and fails like this:

error: Package `env_logger v0.11.1` does not have feature `anstream`. It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name.
sdroege commented 5 months ago

It would be nice to have a bugfix release with this so compilation works with 1.70 again :)

epage commented 5 months ago

The MSRV is set to 1.71 which has the cargo fix for this. Are you also wanting to request a drop in the MSRV? If so, let's discuss that in an issue.

sdroege commented 5 months ago

Ah, sorry for missing that.

MSRV 1.71 is fine for me, I'll just stay with 0.10 for the time being until I update this crate of mine to something newer. Only reason why it's still at MSRV 1.70 is because I didn't have the patience yet to deal with the usual people complaining about requiring a "too new" toolchain :)

epage commented 5 months ago

I know that pain all too well.

The main reason I was willing to update the MSRV so much in 0.11 is because it had breaking changes associated with it (but I don't bump MSRV for breaking changes).

My hope is the MSRV RFC will reduce that pressure. As you are affected, if you haven't looked and commented on it yet, I would recommend it!

sdroege commented 5 months ago

I looked at one of the initial versions and it seemed like a huge improvement over the current situation. The latest version still looks good to me. Having the resolver consider MSRV would allow me to simply support the latest in most crates and have everything else be the problem of the users with annoying version requirements (-> they would just have to stay at an older version of various crates too then instead of dependency resolution failing).

Thanks for working on this :)