druntime: Treat WASI as Posix - #23475
Conversation
DMD perf check
|
|
Append with empty changelist, and push. |
42e203b to
01a5a7c
Compare
kinke
left a comment
There was a problem hiding this comment.
I've already approved of this for LDC, where WASI druntime support is CI-tested now (with D stable/v2.113), and all druntime unittests pass, as well as the awesome importc_compare.d test verifying the bindings (the error-exclusion list additions are still missing for that test in this PR).
The ongoing core.thread refactoring causing immediate merge conflicts is unfortunate.
Ooooh. Right. I'll get that (and fix the merge conflict). |
|
An extra reminder. This impacts your thread refactoring. |
|
@QuantumSegfault thanks, #23481 rebased |
| {} | ||
| else version (Solaris) | ||
| {} | ||
| else version (WASI) |
There was a problem hiding this comment.
@QuantumSegfault Why was there this lines was added?
We decided to rely on Posix or ...?
There was a problem hiding this comment.
Yes. Rather than supporting WASI directly, we're using emulated Posix.
wasi-libc is MOSTLY Posix compliant (for our purposes).
But they for instance don't provide semaphores (it's straight up not defined in the current release; it will soon be defined, but always error out ENOTSUP).
Signals aren't supported either.
There was a problem hiding this comment.
What about mutexes? Without it multithreading will not work in D because GC needs it
There was a problem hiding this comment.
I disabled COLLECT_PARALLEL and COLLECT_FORK on WASI (WASI is single-threaded at the moment)
But they do support mutex.
I tested it in LDC, all the DRuntime unit-tests pass (some involve GC collections)
Adds WASI (or rather wasi-libc) support to core.sys.posix, and makes all WASI triples define Posix.
Also removes or adjust other WASI specific code accordingly.
Upstreaming of ldc-developers/ldc#5230