Stream: wasi

Topic: rustc wasm32-wasi stubbed vs. missing functions


view this post on Zulip acfoltzer (Mar 30 2020 at 18:04):

Some of our users have been struggling with figuring out whether or not a particular crate is good to go on wasm32-wasi. Much of that is due to crates that build/link native code, but some of it is also the fact that some of the functions in std are present but panic when called. I'm wondering just how bad an idea it'd be to omit the functions we don't support, rather than having them fail at runtime, so that these would be compile-time failures instead?

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:32):

@acfoltzer this is definitely a topic of historical hot debate in rust

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:32):

it's unfortunately a pretty tricky one though

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:32):

the short answer is that this wouldn't be easily done, but it's certainly possible

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:33):

this'd be something to bring up w/ the libs team or on users.r-l.o

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:33):

most likely

view this post on Zulip acfoltzer (Mar 30 2020 at 18:34):

thanks. yeah, I figured there was some story about it. I'm guessing the horse is probably out of the barn but I'll poke around a bit further

view this post on Zulip acfoltzer (Mar 30 2020 at 18:35):

I've already poked one hornet's nest with FFI-unwind, not sure I'm up for another one until that's resolved :)

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:55):

@acfoltzer do you have an idea of what sort of apis folks are most surprised don't work?

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:55):

like is it all one set of APIs? or is it basically a smattering all over?

view this post on Zulip acfoltzer (Mar 30 2020 at 18:55):

I think it's mostly the one in Thread::new(), where a library spins up a worker thread or something

view this post on Zulip acfoltzer (Mar 30 2020 at 18:55):

they're not really encountering it in code they write directly

view this post on Zulip acfoltzer (Mar 30 2020 at 18:56):

or something tries to get its threadid

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:56):

ah ok makes sense

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:56):

we can probably fix the threadid thing

view this post on Zulip Alex Crichton (Mar 30 2020 at 18:56):

Thread::new() is pretty fundamental though :(

view this post on Zulip acfoltzer (Mar 30 2020 at 18:56):

(we are still on 1.40.0 for WASI snapshot reasons, so this may be out of date feedback)

view this post on Zulip acfoltzer (Mar 30 2020 at 18:57):

yeah definitely. probably don't want to mess with that one till coroutines land


Last updated: Nov 22 2024 at 16:03 UTC