iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://github.com/emscripten-core/emscripten/issues/22907
WASMFS disables "emulated posix tcp Sockets over WebSockets" · Issue #22907 · emscripten-core/emscripten · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASMFS disables "emulated posix tcp Sockets over WebSockets" #22907

Open
manin opened this issue Nov 11, 2024 · 3 comments
Open

WASMFS disables "emulated posix tcp Sockets over WebSockets" #22907

manin opened this issue Nov 11, 2024 · 3 comments

Comments

@manin
Copy link

manin commented Nov 11, 2024

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.70 (b53978e)
clang version 20.0.0git (https:/github.com/llvm/llvm-project f52b89561f2d929c0c6f37fd818229fbcad3b26c)
Target: wasm32-unknown-emscripten
Thread model: posix

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.

@kripken
Copy link
Member

kripken commented Nov 12, 2024

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?

@sbc100
Copy link
Collaborator

sbc100 commented Nov 12, 2024

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?

@kripken
Copy link
Member

kripken commented Nov 12, 2024

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants