nix
nix copied to clipboard
Initial wasi/wasm support for fs, uio, zerocopy
References https://github.com/nix-rust/nix/issues/786 ~~Depends on https://github.com/rust-lang/libc/pull/3143, hence marking as a draft.~~ Done
This implements WASI support sufficient to build the fs, uio, and zerocopy features (enough to build coreutils 🙂)
Lots of stuff is flagged out since file permissions aren't present in wasi_snapshot_preview1 which is what rust supports out of the box for wasm32-wasi.
One kind of weird thing is dealing with PATH_MAX. WASI doesn't define one, it's whatever the host system is, but afaik there's not an API to get this. So for WASI I defaulted to libc's "linux_like" value of 4096. Let me know what you think.
Looks like build failure is a flake
I guess these changes could also be applied to target="emscripten", am I right?
Just asking because I'm targeting this platform :)