@Alex Crichton hey I saw you were helping out with TCP support in the Rust stdlib. Am I remembering it correctly that you also originally authored the socket2
crate?
I'm not going to ask you to do any work here. But I was wondering if say, hypothetically I was interested in updating socket2
. Do we need an updated version of wasi-libc
for that? Or do we think this is something that we can do with just the wasi
crate?
The BSD socket stuff seems pretty involved, so my gut feeling says that we'd be reimplementing a lot of wasi-libc
if we did it directly. But I figured I should ask!
I'd probably recommend using wasi-libc APIs, so for this I'd recommend waiting for libc
to update with https://github.com/rust-lang/libc/pull/3892 and then adding the build target to the crate from there
okkkk, that's good to know - thank you for confirming!
but if you'd like I'm more than happy to be cc'd on a PR for support, this is something that I'd like to double-check what the needs from the standard library are
the standard library exposes a few fd-related things which need to be updated
(possibly in a breaking way, which also reminds me that I should go do it now)
oh wait, right - does the stdlib depend on socket2?
it doesn't, but socket2 may rely on extensions the standard library provides in std::os::wasi
, and that's an outdated module on the p2 target
by the way, to add context to what I'm doing: I'm currently mapping out what is needed to enable the smol
async runtime to work with WASI 0.2. socket2
seems to be in the critical path for that.
Alex Crichton said:
it doesn't, but socket2 may rely on extensions the standard library provides in
std::os::wasi
, and that's an outdated module on the p2 target
ahhh, i see! - that makes sense!
Alex Crichton said:
it doesn't, but socket2 may rely on extensions the standard library provides in
std::os::wasi
, and that's an outdated module on the p2 target
ok scratch this, std::os::wasip2
is stable, but empty, and std::os::wasi
is unstable on the wasip2 target, as intended, so everything is working as expected there
@Yoshua Wuyts I don't know if it's helpful, but I created enough of a fake socket2
library to get tokio-postgres
working as part of my wasi-sockets-tests experiments, for which I created experimental forks of Rust, mio
, tokio
, and rust-postgres
: https://github.com/sfackler/rust-postgres/compare/master...dicej:rust-postgres:wasi-sockets
ohhh, that's so sick!
ty for sharing!
Last updated: Nov 22 2024 at 17:03 UTC