-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
[Web] Disable UNIX sockets #98954
[Web] Disable UNIX sockets #98954
Conversation
b400de1
to
cf35f25
Compare
drivers/unix/os_unix.cpp
Outdated
#ifndef UNIX_SOCKET_UNAVAILABLE | ||
NetSocketPosix::make_default(); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call this POSIX_SOCKET_UNAVAILABLE
? Technically it's about the Unix implementation, but the class it disables is the Posix one and includes the Windows implementation too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe POSIX_SOCKET_UNAVAILABLE
would indeed be a better name.
I'm just reusing UNIX_SOCKET_UNAVAILABLE
which was added in #32454 to allow building on some console platform.
I've actually been thinking about splitting Windows sockets since they've diverged quite a bit from the posix one (and their "compatibility" layer is not compatible)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah splitting Windows sockets might make sense, I've thought about this too on and off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened #98969 which does that.
This should probably be documented in some places? |
What is the problem with disabling it? Something in web heavily depends on it? I don't know anything about network but from reading description on site of miniupnp I got a feeling it anyway won't work in web or not? It looks like it can be easily disabled like already disabled raycast module Lines 68 to 75 in cf35f25
|
@dustdfg unlike the raycast module, UPNP adds exposed types. This means that if your GDScript includes references to that type, the script will fail parsing, even if you don't actually use it in web builds. |
Needs to be rebased now that #98969 is merged |
They are not supported anyway, emscripten has an emulation layer that implements them over WebSocket/WebRTC, which is really surprising for users, and also not very useful since we have proper WebSocket and WebRTC support. This can make the build smaller, if we also disable the UPNP module (which will otherwise include a third party library referencing "socket" thus forcing emscripten to include the compatibility layer)
cf35f25
to
9383610
Compare
Thanks! |
They are not supported anyway, emscripten has an emulation layer that implements them over WebSocket/WebRTC, which is really surprising for users, and also not very useful since we have proper WebSocket and WebRTC support.
This can make the build smaller, if we also disable the UPNP module (which will otherwise include a third party library referencing "socket" thus forcing emscripten to include the compatibility layer)
Fixes #98389