Add WASI platform#2290
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
|
The usual https://ampcode.com/threads/T-019dec8c-2eb3-73ab-8edf-c77623152593 Pick and choose - it does seem like we should define CLOSED_FD as -1 - but your call. PR Review: WASI Platform + Socket HardeningReviewing the last two commits:
The combined diff is large; this review focuses on real correctness issues and small, actionable suggestions, rather than style. Summary
The remaining WASI-specific socket hardening ( 1.
|
883f7ca to
e572044
Compare
- Handle spurious select wakeups
- Allow linger and reuseaddr as no-ops if unsupported
- Add nif_select_write/2 to strengthen send/sendto
- Update tests to run when there is no inet driver
- Fix socket operations to return {error, closed} when the fd is closed
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Adopt OTP semantics for calls such as gen_tcp:close(Pid) when the gen_server is already closed, thus fixing a race condition in tests Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Introduces the WASI (WebAssembly System Interface) platform allowing AtomVM to run as a pure WebAssembly module under runtimes such as wasmtime, WasmEdge, and wasmer. Three target triples are supported: - wasm32-wasip1: no SMP, no networking - wasm32-wasip1-threads: SMP via wasi-threads, no networking - wasm32-wasip2: networking via wasi:sockets@0.2.x, no SMP Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Also make significant fixes to socket to accomodate for wasi-libc.
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later