Hello,
i want to completly remove the debug informations that rust compiled in my binary for the panic functions. I want do preserve the functions that panic and only catch the panic functions, that there not show debug informations (only my own infos) and let the rest of the panic function functional.
I want only the debug_infos out of my binary and let the panic functions functional.
How i can i do that globally?
When i hook or something in my main.rs the binary size going to 20% and all functions that can panic and i have matched like options and results are still not functional.
I've just implemented something like it that disables Debug::fmt:
But in the official compiler builds, there's no good way to do that. There's -Zlocation-detail that removes file paths, but not the Debug text. There's possibility of rebuilding libstd with panic_immediate_abort that removes all panic text, but also removes ability to catch panics.
@kornel Yes a very good suggestion. I don't know why the rust-core-team are so against a complete debug info free binary. Only one compiler setting parameter and we the coders have a free choice. I hope in the future option like yours will be in the stable branch and we can remove more debug infos out of the binary.
I have so long only coded with the stable branch. And now i must istall the nightly branch and use -Zlocation-detail=none for a little removing of some debug infos.
Install xargo and rebuilding libstd to use panic_immediate_abort is to crazy for me.
@kornel Oh no its functioned. "RUSTFLAGS=-Zlocation-detail=none" and rebuild of libstd with cargo +nightly build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-pc-windows-gnu --release the most debug infos are striped and the size of binary is crunched to around 20%. Thats cool, thx for your tips.