Commit Graph

9 Commits

Author SHA1 Message Date
Johnathan Sharratt
5c2f00119f Added the new thread start routines 2023-03-07 00:19:16 +11:00
Johnathan Sharratt
1eba7cffb0 Fixed the proc_join syscall 2023-03-04 04:41:47 +11:00
Johnathan Sharratt
e39c438dfa Staging changes ready for WASIX syscall changes 2023-03-04 03:37:36 +11:00
Johnathan Sharratt
dd8c902e4c Fixed the signals and error codes 2023-03-03 23:33:06 +11:00
Christoph Herzog
cbcae65d71 Merge remote-tracking branch 'origin/wasix-major-fixes-and-tweaks' into wasix 2023-02-16 06:11:48 +01:00
Christoph Herzog
506da0bdd7 chore: Remove all WASIX bus and event related syscalls + types
The implementations were previously already replaced with stub impls.
After ensuring that the current wasix modules don't actually import the
syscalls, we can now safely remove all the plumbing, including:

* syscalls
* types
2023-02-15 15:55:56 +01:00
Johnathan Sharratt
c12a60f9a7 Many bug fixes and performance optimizations
- Removed generation_arena which was causing some serious leakages of files and sockets
- Added OsError for NetworkErrors so that "Too Many Open Files" is properly passed
- Local networking will now cap at 10 sockets in the backlog
- Added the missing shutdown error code
- Removed the inodes lock around most of the WASI syscalls
- Fixed some race conditions in the event notifications for WASI
- The polling loop will now only notify a closed socket once
- Event notifications now uses Wakers rather than MPSC
- Some socket errors now return the right codes which prevents panics in WASM
- Fixed a bug where the file read and write guards might release the file before the lock
- The inode seed is now much safer preventing overlaps
- The fd seed is now much safer preventing overlaps
- Closing files is now implicit rather than explicit reducing possibliities for error
- Forking of file descriptors is now much simplier
- Polling events will now be returned in random order to prevent some race conditions
- Removed a number of memory allocations which were wasting memory and performance
- Sockets now only copy the send and recv data once rather than multiple times
2023-02-15 16:13:48 +11:00
Christoph Herzog
fa7ac64398 wasi-types: Add wasix http bindings
Initial step towards implementing wasix http client support for Wasm
instances using WAI generated bindings.

Adds a "wasix_http_client_v1.wai" schema for http clients.

Extends the wasi-types type generator to also generate Wasmer host
bindings for the wasix_http_client_v1 bindings.
These are written to wasi-types/src/wasix.
Some custom fixup of the bindings is needed.

Also adds a patch to Cargo.toml that forces wai-bindgen-wasmer to use
the repo-local wasmer crate.

Also adds generation of Rust client bindings.
2022-12-11 05:55:07 +01:00
Christoph Herzog
3b27b50880 build: Refactor wasi-types regenerate.sh to Rust
Replace the lib/wasi-types/regenerate.sh shell script with a Rust
implementation.

We already had some Rust fixup code in lib/wasi-types/wasi-types-generator-extra.

This mostly just converts the "wai-bindgen" CLI invokation into Rust
code that uses the wai-bindgen crates as a dependency.

Also moves the .wit files from "wit-clean" to ./schema/wasi and uses the
.wai extension.

The ./schema dir will also hold Wasix-specific definitions in the future.
2022-12-09 20:14:32 +01:00