When I run a binary using cargo, I have the option to run it as follows -
bash -c "RUST_BACKTRACE=1 cargo run --bin my_binary"
This gives me a stack trace when the binary hits an error. But when I create a Debian package for the same binary, how do I get stack traces on failure?
Is there some way to enable backtrace there too, if the source is implemented in Rust?
Edit:
I create a debian package for my cargo project using
cargo deb // Produces a my_binary.deb
This my_binary.deb can then be installed on a Debian machine as -
dpkg -i /tmp/my_binary*.deb || true \
&& apt-get -f -y install
RUST_BACKTRACE=1 cargo run --bin my_binary
in a normal shell works for me under Debian. (Your question is somewhat unclear, what do you mean by "create a debian"?) – Ravinemy_binary
. Have edited the question. Hope it better explains now. – SaxhornRUST_BACKTRACE=1 my_binary
? – Ravine