1.1.0 • Published 3 years ago
@cowasm/coreutils v1.1.0
Some of FreeBSD Ported to WebAssembly
For use in https://cowasm.org.
- This includes many of the coreutils in the utils directory. We aren't porting everything, e.g.,
chrootdoesn't make a lot of sense in the context of WebAssembly/WASI.
Known broken things
tail -fdoesn't work because epoll isn't implemented in cowasm yet. See posix/epoll.ts elsewhere.splitdoesn't work due to freopen and other issues I haven't looked into yet.expand foodoesn't work when input is a file instead of stdin. This is because the implementation usesfreopento make the file into stdin, which is a pretty neat trick. The fix isn't to rewrite expand, but instead to fixfreopen. This is extra challenging because our code for running processes then restoring state has to deal with this properly, and probably doesn't now (?). There's also a test of freopen for wasi here that might be inspiring.- Similarly,
foldis broken for exactly the same reason - Also
nlis broken.
- Similarly,
TODO
- the
envcoreutil calls execvp. We should make it work with WASM targets as well. That might just mean changing execvp though, since there is no fork -- it's just exec, which is maybe easier.