* fix: signal.SIGINT and signal() raise NotImplementedError on wasi
- Problem: signal.SIGINT and friends don't exist on wasi, and signal.signal()
is hard-stubbed to raise NotImplementedError there
- Cause: wasi-libc emulates signal()/raise() in a separate opt-in library
that Rust's own wasm32-wasip1 target distribution doesn't ship
- Fix: vendor wasi-sdk's prebuilt libwasi-emulated-signal.a, link it for
wasm32-wasip1, and wire SIGINT/SIGABRT/SIGFPE/SIGILL/SIGSEGV/SIGTERM,
signal()/getsignal()/raise_signal() through it. CPython's own WASI build
links the same library
Assisted-by: Claude Code:claude-sonnet-5
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
* Group WASI signal definitions in mod wasm
Move WASI-only types, constants, FFI, and handlers into
`mod wasm` and re-export them with `#[cfg(target_os = "wasi")]`.
Assisted-by: Grok 4.6
---------
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
Co-authored-by: Jeong YunWon <jeong@youknowone.org>
* Fix WASM memory allocation failure (#4989)
This commit addresses the unbounded memory allocation issue on WASM targets that caused minimal programs (like = 1) to fail with ~79MB allocation errors in constrained runtimes like wasmi.
The fixes include:
1. Capping the max memory limit at 64MB and restricting stack size to 1MB via linker flags in .cargo/config.toml.
2. Reducing the minimum chunk size of the DataStack from 16KB to 4KB on WASM targets to shrink the initial memory footprint.
3. Adding a wasm-release profile in the root Cargo.toml optimized for size with opt-level = s, LTO enabled, and symbols stripped.
* Trigger CI rerun
* Address review feedback: add comments, use cfg! for MIN_CHUNK_SIZE
* Remove duplicate MIN_CHUNK_SIZE definition
* Fix duplicate MIN_CHUNK_SIZE and format for prek lint
* Update CI to use wasm-release profile for WASM tests
* Remove leftover conflict markers
* Clean remaining conflict markers in CI workflow
* Clean remaining conflict markers in CI workflow
* Trigger CI to pick up new required check
* Remove --max-memory flag, keep stack limit only