godot-rust / gdext

Rust bindings for Godot 4

Home Page:https://mastodon.gamedev.place/@GodotRust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How/Where to pass RUST_BACKTRACE=1?

ColmMathews opened this issue · comments

Sorry for the likely simple question - I'm trying to find the source of a panic in my code but I'm not seeing the stacktrace.

I've tried setting it in rust using
env::set_var("RUST_BACKTRACE", "1");
and in godot using
OS.set_environment("RUST_BACKTRACE", "1")

Are you running Godot with the console? I am currently doing
unsafe { env::set_var("RUST_BACKTRACE", "full"); } (1 also works)
in a ready function and I am seeing panic full stacktraces in the console

@AJ213 thanks for the suggestion - I gave it a try but unfortunately it didn't work.
I'm thinking now it could be due to a signal invocation
image

@ColmMathews The other potential reason, which I just ran into now, is set_var isn't being called early enough. Could you share what your Godot console looks like? Not the one inside Godot, but the console that appears when you run the Godot with console exe. If you are using Linux (like I am) you can instead run Godot in a terminal (or write a script to do it).