nix icon indicating copy to clipboard operation
nix copied to clipboard

Initial wasi/wasm support for fs, uio, zerocopy

Open connor4312 opened this issue 2 years ago • 2 comments
trafficstars

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.

connor4312 avatar Mar 07 '23 23:03 connor4312

Looks like build failure is a flake

connor4312 avatar Mar 09 '23 17:03 connor4312

I guess these changes could also be applied to target="emscripten", am I right? Just asking because I'm targeting this platform :)

atilag avatar Sep 11 '23 23:09 atilag