Commit Graph
5 Commits
Author SHA1 Message Date
Jiwoo AhnandJeong YunWon ef5c651958 fix: signal.SIGINT and signal() raise NotImplementedError on wasi (#8986)
* 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>
2026-10-07 04:57:13 +00:00
Alok Pandey 5f789c6146 Fix WASM memory allocation failure (#4989) (#7887)
* 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
2026-06-03 20:32:24 +09:00
Jeong, YunWon aa0eb4bedf rustpython-common wasm_js feature (#6116) 2025-09-17 09:11:13 +09:00
Jeong YunWon 18b7315c9a Fix windows stack size again 2021-10-02 14:09:31 +09:00
Jeong YunWon 5a06c80237 increase stack size for windows 2021-09-19 23:11:33 +09:00