-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add wasm32-wasip2 definitions necessary for std::net support #3892
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Thanks for this @nickrum! For the missing constants/types mind filing an issue on wasi-libc itself? I think it's ok to omit those here and handle libstd by either:
|
@alexcrichton Thanks for having a look! It seems like the Edit: Issue filed (WebAssembly/wasi-libc#531) |
I don't know a huge amount about that but I think it should be fine to include yeah. I think if you edit Thanks for filing an issue! |
Ah, sorry! Looks like Now I'm running into a strange issue, where the tests succeed no matter what's in the |
Do you mean locally or in CI? It sounds a bit like the |
I believe that |
2f44842
to
65e08f7
Compare
This was happening locally and only for the |
Okay, great! I didn't take an in-depth look at everything here but @alexcrichton if this looks good to you, I am happy to merge. |
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.
Looks good to me!
Thanks for authoring Nicola & thanks for reviewing Alex |
(backport <rust-lang#3892>) (cherry picked from commit 78e7b89)
(backport <rust-lang#3892>) (cherry picked from commit 78e7b89)
This moves the bindings necessary for rust-lang/rust#129638 to libc. Unfortunately, I wasn't able to test this with the standard library due to #3789. Is there any workaround for that issue?
Header sources:
sa_family_t
in_port_t
in_addr_t
socklen_t
sockaddr
in_addr
sockaddr_in
in6_addr
sockaddr_in6
sockaddr_storage
addrinfo
ipv6_mreq
[SHUT_RD, SHUT_WR, SHUT_RDWR, MSG_NOSIGNAL, MSG_PEEK, SO_REUSEADDR, SO_ERROR, SO_RCVTIMEO, SO_SNDTIMEO, SOCK_DGRAM, SOCK_STREAM, SOL_SOCKET, AF_INET, AF_INET6]
[IPPROTO_IP, IPPROTO_TCP, IPPROTO_IPV6]
[IP_TTL, IP_MULTICAST_TTL, IP_MULTICAST_LOOP, IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP, IPV6_MULTICAST_LOOP, IPV6_JOIN_GROUP, IPV6_LEAVE_GROUP, IPV6_V6ONLY, IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP]
TCP_NODELAY
EAI_SYSTEM
[socket, connect, bind, listen, accept, getsockname, getpeername, sendto, recvfrom, getsockopt, setsockopt]
[getaddrinfo, freeaddrinfo, gai_strerror]
There is one problem that I just now realized when I collected all the header sources: The
ip_mreq
struct and theSO_BROADCAST
constant aren't actually defined in wasi-libc, but they are needed since the standard library uses them insys_common
. Could this be an oversight given thatipv6_mreq
and most of the otherSO_*
constants are in fact defined? I assume this means I have to add them to wasi-libc before this PR can be merged?cc @alexcrichton