failure icon indicating copy to clipboard operation
failure copied to clipboard

std without backtrace?

Open aep opened this issue 7 years ago • 6 comments

backtrace is fairly heavyweight and sometimes straight up doesnt work (on mips for example).

Unfortunately the std feature depends on backtrace. Is that just something that needs fixing or is it intentional?

aep avatar Aug 18 '18 22:08 aep

I hope I'm getting this right, but I believe backtraces can be toggled using the RUST_BACKTRACE env var which means they should have no performance impact unless enabled.

yoshuawuyts avatar Aug 19 '18 11:08 yoshuawuyts

doesnt compile on android either. it refferences a GNU only symbol __errno_location

so both mips and android are broken

aep avatar Sep 13 '18 15:09 aep

If it's GNU-only, wouldn't that mean that Windows would have similar hurdles? To my knowledge failure also works on Windows.

Perhaps there's a non-GNU solution available there that might serve as a basis for fixing MIPS/Android?

yoshuawuyts avatar Sep 13 '18 23:09 yoshuawuyts

probably not. this is in unix.o (ironic, since thats GNU not unix)

anyway, this is all i need to do to disable backtrace. it compiles fine, apparantly its already behind a feature switch.

is there any way i can do this without forking?

diff --git a/Cargo.toml b/Cargo.toml
index d8c505a..7be6605 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,7 @@ version = "0.3.3"
 members = [".", "failure_derive"]
 
 [features]
 default = ["std", "derive"]
 #small-error = ["std"]
-std = ["backtrace"]
+std = []
 derive = ["failure_derive"]


aep avatar Sep 14 '18 17:09 aep

allright. i have forked failure with the one line fix, since patch doesnt seem like a good permanent solution

https://crates.io/crates/failure_without_backtrace

aep avatar Oct 19 '18 08:10 aep

I could use such thing too.

Maybe remove the std→backtrace dependency, but put backtrace between defaults? Could this be done?

vorner avatar Oct 24 '18 08:10 vorner