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

WASI socket support #96320

Closed
tiran opened this issue Aug 26, 2022 · 4 comments
Closed

WASI socket support #96320

tiran opened this issue Aug 26, 2022 · 4 comments
Labels
OS-wasi type-feature A feature request or enhancement

Comments

@tiran
Copy link
Member

tiran commented Aug 26, 2022

Feature or enhancement

WASI has limited support for BSD-like sockets in snapshot preview 1. tl;dr it is not possible to open new connections. The WASI runtime must pass a socket file descriptor into the process. Preview 1 supports both connected client-side socket and accept() on bound listening sockets. poll() is available as well, although limited to poll_oneoff. bind, connect, sendto / recvfrom, DNS lookup and NETDB (gethostbyname, getaddrinfo, getservbyname) etc are not available.

Let's document the missing functions and address the remaining issues to get socketserver and simple clients working.

Previous discussion

GH-95179 addressed several missing functions that prevented us to compile the socket module on WASI.

@tiran tiran added the type-feature A feature request or enhancement label Aug 26, 2022
tiran added a commit to tiran/cpython that referenced this issue Aug 29, 2022
- ignore missing functions in ``socket.__repr__``
- bundle network files with assets
tiran added a commit to tiran/cpython that referenced this issue Aug 29, 2022
- ignore missing functions in ``socket.__repr__``
- bundle network files with assets
tiran added a commit to tiran/cpython that referenced this issue Aug 29, 2022
- ignore missing functions in ``socket.__repr__``
- bundle network files with assets
tiran added a commit that referenced this issue Aug 30, 2022
* gh-96320: WASI socket fixes

- ignore missing functions in ``socket.__repr__``
- bundle network files with assets

* blurb
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 11, 2022
* pythongh-96320: WASI socket fixes

- ignore missing functions in ``socket.__repr__``
- bundle network files with assets

* blurb
(cherry picked from commit d0b3d23)

Co-authored-by: Christian Heimes <christian@python.org>
tiran pushed a commit that referenced this issue Sep 13, 2022
- ignore missing functions in ``socket.__repr__``
- bundle network files with assets
@brettcannon
Copy link
Member

FYI this should be coming in WASI preview2.

@brettcannon
Copy link
Member

brettcannon commented Feb 27, 2024

dicej@118e9d8 shows what should be necessary once wasi-libc has socket support.

@brettcannon brettcannon changed the title [WASI] socket support WASI socket support Feb 27, 2024
@brettcannon
Copy link
Member

Closing as this is only possible once WASI-libc lands support.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-wasi type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants