You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building with WASMFS disables emulated posix tcp Sockets over WebSockets. We’ve ported a large codebase to Emscripten that relies on this socket emulation, and it works well. However, we also want to use OPFS, but currently, WASMFS and POSIX socket emulation cannot be used together.
Additionally, emscripten_set_socket_*_callback symbols are not exported, resulting in link-time errors. For example, we use emscripten_set_socket_message_callback in a reactor, and this fails to link.
Is there any workaround to use OPFS and posix socket emulation? Alternatively, are there any plans to support this combination?
The SOCKFS backend for the old FS needs to be ported to WasmFS. Or, there was an idea to write a general shim that would run any of the old backends in WasmFS. I am not aware of current work on either, but this is definitely something that would be good to have.
@sbc100 I recall you were doing some cleanups on sockets code recently - were you aiming to do this perhaps?
The SOCKFS backend for the old FS needs to be ported to WasmFS. Or, there was an idea to write a general shim that would run any of the old backends in WasmFS. I am not aware of current work on either, but this is definitely something that would be good to have.
@sbc100 I recall you were doing some cleanups on sockets code recently - were you aiming to do this perhaps?
No, those were more just correctness and cleanups. Do you think we should write a compat layer for this kind of FS backend?
Yeah, I think a compat layer is worth looking into. It seems like it could get us SOCKFS, IDBFS, WORKERFS etc all in one go. That could get many (most?) of the remaining tests passing on WasmFS.
(I feel this is important, but there may be more urgent things overall.)
Version of emscripten/emsdk:
Building with WASMFS disables emulated posix tcp Sockets over WebSockets. We’ve ported a large codebase to Emscripten that relies on this socket emulation, and it works well. However, we also want to use OPFS, but currently, WASMFS and POSIX socket emulation cannot be used together.
Specifically:
Every socket syscall becomes a stub in system/lib/wasmfs/syscalls.cpp
Additionally, emscripten_set_socket_*_callback symbols are not exported, resulting in link-time errors. For example, we use emscripten_set_socket_message_callback in a reactor, and this fails to link.
Is there any workaround to use OPFS and posix socket emulation? Alternatively, are there any plans to support this combination?
The emulated posix tcp Sockets over WebSockets documentation should also be updated to reflect that it won’t work with -sWASMFS.
The text was updated successfully, but these errors were encountered: