Wasm normally doesn't have a concept of an "environment" so wasm32-unknown-unknown target just returns
getenv. Relevant code:
- I think this is the function called to get an environment variable (
os_impis declared as this for Wasm: https://github.com/rust-lang/rust/blob/e413d89aa706060ddc347e1e06d551ec86d3f471/library/std/src/sys/wasm/mod.rs#L30-L31
- which just returns
So RUST_BACKTRACE is never enabled in wasm32-unknown-unknown builds.
I'm wondering if there's another way of enabling backtraces. Is this possible? I asked this many times in different places before and the answer was always "no", but I'm wondering if anything changed.
If the answer is still "no" then there's no way to enable Rust backtraces in wasm32-unknown-unknown builds, which is unfortunate. Does anyone know any workarounds for this? Or any hacks? I searched for open issues in Rust GH page but couldn't find anything relevant.