-
Notifications
You must be signed in to change notification settings - Fork 137
Separate backtrace and std features? #127
Comments
You could instead make both std and backtrace default features, I believe. |
OK! Thank you for the quick response here. Do you think it would be a breaking change to require the In either case, I've submitted https://github.com/withoutboats/failure/pull/128 if that's something you'd want. |
Hi! I would be great having the ability to disable the |
I'm consider going a step further and making backtrace also not a default feature. Its basically impossible not to use backtrace unless all of the libraries you use also turn it off. While in a no-std context this makes sense, for backtrace libraries are unlikely to turn it off because it doesn't impact them. This would mean anyone who wants to use backtraces needs to turn the backtrace feature on in their Cargo.toml. |
Hi there! So if I understand correctly, you say that the backtrace becomes a separate feature, turned off by default. Sounds good! This would mean that by default, the backtrace feature will not "bubble up" from the transitive closure of packages we depend on, unless one of them explicitly enables the feature in its own Cargo.toml? Anyway, thanks for making the library! I haven't had issues moving from |
@radupopescu from my understanding of Cargo features, nothing will have backtraces until a package depends on |
Closed by #144. |
Could this be re-opened per 3d5b8f9? This is still important to me and I'd really like it not to fall between the cracks. I love what failure does for error handling, but this is still blocking effective usage of failure without backtraces. I'm 100% OK with backtraces being default as long as it is possible to disable them without also disabling |
@mitsuhiko (or current maintainer) any possibility this could be opened? I don't have the ability to re-open it. I can make a new issue if necessary. I'd just really like the ability to use |
Gentle ping to @mitsuhiko and @rust-lang-nursery/failure. I'm also again in need of this and it would be better if re-opened. |
If we can find a way to make this backwards compatible I'm accepting PRs :) |
@mitsuhiko I am not sure there is a way to do that, thus this was mostly so that it doesn't get forgotten for next breaking release. Speaking of that, given that rust-lang/rust#53533 landed in nightly already, perhaps 0.2 work (in no-backtrace mode, for now) can already start somewhere? |
Agreeing with @lucab here that doing this right would be a breaking change. We could implement this without a breaking change, but the only way I can think to do it is to add an extra If 0.2 is anywhere close, adding Edit: I've opened #257. |
I too would appreciate if |
In
Cargo.toml
, thestd
feature depends onbacktrace
. Is there a technical reason this is required, or would it be possible to implementFail
forStdError
without depending onbacktrace
?We have a use case in dotenv for using failure crate with std error types as
#[cause]
s, but it would be ideal if we didn't pull in all of thebacktrace
crate.Would it be possible to either:
impl<E: StdError + Send + Sync + 'static> Fail for E {}
separate frombacktrace
andstd
std
feature not depend onbacktrace
?I'd be willing to submit a PR doing this if it's something you'd want to add, but there might be some other thing blocking it that I'm not aware of?
The text was updated successfully, but these errors were encountered: