Hi everyone!
I'm working on a WebAssembly project with Rust 1.85.0-nightly (769f622e1 2024-12-14)
and running into some issues with panic settings. I'm trying to reduce binary size by using panic_immediate_abort
with panic_abort
.
Problem: When I try to set it up, I get this error:
error: package ID specification `panic_unwind` did not match any packages
Build Command:
This completes without an error:
cargo +nightly build --target wasm32-wasip1 --release -Z build-std=std,panic_abort
This doesn't:
cargo +nightly build --target wasm32-wasip1 --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
The only difference is -Z build-std-features=panic_immediate_abort
. I thought the panic_immediate_abort
would stop any unwinding, so I'm not sure why it's looking for panic_unwind
.
Here’s What I’m Using:
- Rust Version:
1.85.0-nightly (769f622e1 2024-12-14)
- RUSTFLAGS:
-Zlocation-detail=none -C strip=none
I am able to build this on 1.84.0-nightly, so the issue likely lies with this release.
Questions:
- How do I set up
panic_immediate_abort
andpanic_abort
to stop unwinding for WASM? - Are there known issues with these flags for WebAssembly in Rust Nightly?
- Could my settings in
RUSTFLAGS
be causing this error? What should I change?
Thanks for any help you can provide!