-
Notifications
You must be signed in to change notification settings - Fork 258
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
Release 0.4.22 breaks --all-features CI testing #635
Comments
The problem is really in the way the log crates uses features as they don't add, but rather remove functionality, so yes there are very much mutually exclusive, see #481 for more.
The |
feel free to close |
I have a larger project that sets |
This by design really. The problem is that the log crate can not determine which feature/filter should be used. Which means you either get more logs than you expect (info instead of off) or no logs at all (off instead info). In the past this lead to surprising results, hence we want to do something about this.
I didn't consider your specific use case. Is there any chance you can move the setting of the features to the (main) binary and benchmarks? I think some of the following might work. [bin]
required-features = ["log/release_max_level_info"]
[bench]
required-features = ["log/release_max_level_off"] A little off topic, but are you sure you want to change the logging at all for your benchmarks? Because it means the compiled code will be different in your benchmarks compared to your binary you're actually running. You're effectively no longer testing the code you're running. |
Rust features are additive. So if feature Before the recent changes, this crate was perfectly inline with Rust's feature semantics: If I set For whatever reason, this is now declared to be a problem. And previous, perfectly fine use-cases result in a compile error. The current release assumes that anybody, who puts a In my opinion, the current release is against feature semantics in Rust. I don't get the rational behind this decision and hope you reconsider these changes. |
The max level features we use in |
If you believe Rust features are the wrong way, that's fine. Then one could switch to One could also rename the features to something like But breaking a perfectly fine system for no reason, prohibiting the use of Rust features the way they are designed and used throughout the ecosystem? |
I think you're misunderstanding what @KodrAus and I have been saying. The Rust features are fine. Log's usage of it is not. I.e. log is the problem. We know this and I think pretty much everybody agrees it's bad, but we don't want to break this, it's something to improve for v1 though.
See comments above, it's wasn't and isn't a perfectly fine system. The goal of the disallowing multiple filter feature is because Log usage of features is wrong. This leads to surprising results w.r.t. things being not logged, see @KodrAus comment above. @bastibl did you try the solution I suggested in #635 (comment)? |
I fully understand what you are doing and why you are doing it. I just believe that using features and disallowing additive features by raising a compile error is the worst of both worlds. Anyway, I see you're fond of your current solution and are not up for discussion. The solution I found is switching to tracing. It can be used as a drop-in replacement: https://docs.rs/tracing/latest/tracing/#for-log-users So I'm fine as long as you don't pitch your solution to the tracing developers :-) |
We're not fond of the solution... I still feel like we're having a miscommunication here. |
A recent change in the
log
0.4.22 release, #627, breaks CI for any project that depends on the log crate and uses cargo--all-features
for testing.The
tracing
crate has equivalent "max-level" features and chooses to resolve them by defining a priority: https://docs.rs/tracing/latest/src/tracing/level_filters.rs.htmlIt can be confusing that cargo features are additive, but that is how the capability has been designed. Though discouraged, rust documentation does allow for compilation errors on truly mutually-exclusive features. However, this arguably should not be introduced in a point release.
The text was updated successfully, but these errors were encountered: