8000 Document WASI restrictions · python/cpython@f05c396 · GitHub
[go: up one dir, main page]

Skip to content

Commit f05c396

Browse files
committed
Document WASI restrictions
1 parent 9d6a9e9 commit f05c396

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Tools/wasm/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,27 @@ AddType application/wasm wasm
220220

221221
# WASI (wasm32-wasi)
222222

223-
WASI builds require [WASI SDK](https://github.com/WebAssembly/wasi-sdk) and
224-
currently [wasix](https://github.com/singlestore-labs/wasix) for POSIX
223+
WASI builds require [WASI SDK](https://github.com/WebAssembly/wasi-sdk) 15.0+
224+
and currently [wasix](https://github.com/singlestore-labs/wasix) for POSIX
225225
compatibility stubs.
226226

227+
## WASI limitations and issues (WASI SDK 15.0)
228+
229+
A lot of Emscripten limitations also apply to WASI. Noticable restrictions
230+
are:
231+
232+
- Call stack size is limited. Default recursion limit and parser stack size
233+
are smaller than in regular Python builds.
234+
- ``socket(2)`` cannot create new socket file descriptors. WASI programs can
235+
call read/write/accept on a file descriptor that is passed into the process.
236+
- ``socket.gethostname()`` and host name resolution APIs like
237+
``socket.gethostbyname()`` are not implemented and always fail.
238+
- ``chmod(2)`` is not available. It's not possible to modify file permissions,
239+
yet. A future version of WASI may provide a limited ``set_permissions`` API.
240+
- File locking (``fcntl``) is not available.
241+
- ``os.pipe()``, ``os.mkfifo()``, and ``os.mknod()`` are not supported.
242+
243+
227244
# Detect WebAssembly builds
228245

229246
## Python code

0 commit comments

Comments
 (0)
0