Commit 3e5b30b
Start to port Wasmtime to the new wasi-io API with resources. (bytecodealliance#7029)
* Rename `Host*` things to avoid name conflicts with bindings.
* Update to the latest resource-enabled wit files.
* Adapting the code to the new bindings.
* Update wasi-http to the resource-enabled wit deps.
* Start adapting the wasi-http code to the new bindings.
* Make `get_directories` always return new owned handles.
* Simplify the `poll_one` implementation.
* Update the wasi-preview1-component-adapter.
FIXME: temporarily disable wasi-http tests.
Add logging to the cli world, since stderr is now a reseource that
can only be claimed once.
* Work around a bug hit by poll-list, fix a bug in poll-one.
* Comment out `test_fd_readwrite_invalid_fd`, which panics now.
* Fix a few FIXMEs.
* Use `.as_ref().trapping_unwrap()` instead of `TrappingUnwrapRef`.
* Use `drop_in_place`.
* Remove `State::with_mut`.
* Remove the `RefCell` around the `State`.
* Update to wit-bindgen 0.12.
* Update wasi-http to use resources for poll and I/O.
This required making incoming-body and outgoing-body resourrces too, to
work with `push_input_stream_child` and `push_output_stream_child`.
* Re-enable disabled tests, remove logging from the worlds.
* Remove the `poll_list` workarounds that are no longer needed.
* Remove logging from the adapter.
That said, there is no replacement yet, so add a FIXME comment.
* Reenable a test that now passes.
* Remove `.descriptors_mut` and use `with_descriptors_mut` instead.
Replace `.descriptors()` and `.descriptors_mut()` with functions
that take closures, which limits their scope, to prevent them from
invalid aliasing.
* Implement dynamic borrow checking for descriptors.
* Add a cargo-vet audit for wasmtime-wmemcheck.
* Update cargo vet for wit-bindgen 0.12.
* Cut down on duplicate sync/async resource types (#1)
* Allow calling `get-directories` more than once (bytecodealliance#2)
For now `Clone` the directories into new descriptor slots as needed.
* Start to lift restriction of stdio only once (bytecodealliance#3)
* Start to lift restriction of stdio only once
This commit adds new `{Stdin,Stdout}Stream` traits which take over the
job of the stdio streams in `WasiCtxBuilder` and `WasiCtx`. These traits
bake in the ability to create a stream at any time to satisfy the API
of `wasi:cli`. The TTY functionality is folded into them as while I was
at it.
The implementation for stdin is relatively trivial since the stdin
implementation already handles multiple streams reading it. Built-in
impls of the `StdinStream` trait are also provided for helper types in
`preview2::pipe` which resulted in the implementation of
`MemoryInputPipe` being updated to support `Clone` where all clones read
the same original data.
* Get tests building
* Un-ignore now-passing test
* Remove unneeded argument from `WasiCtxBuilder::build`
* Fix tests
* Remove some workarounds
Stdio functions can now be called multiple times.
* If `poll_oneoff` fails part-way through, clean up properly.
Fix the `Drop` implementation for pollables to only drop the pollables
that have been successfully added to the list.
This fixes the poll_oneoff_files failure and removes a FIXME.
---------
Co-authored-by: Alex Crichton <[email protected]>1 parent 4b288ba commit 3e5b30b
File tree
102 files changed
+5212
-4965
lines changed- crates
- test-programs
- command-tests/src/bin
- reactor-tests/src
- tests
- wasi-http-proxy-tests/src
- wasi-http-tests/src
- wasi-sockets-tests/src
- bin
- wasi-tests/src/bin
- wasi-http
- src
- wit
- deps
- cli
- clocks
- filesystem
- http
- io
- logging
- poll
- random
- sockets
- wasi-preview1-component-adapter
- src
- wasi
- src/preview2
- host
- filesystem
- stdio
- wit
- deps
- cli
- clocks
- filesystem
- http
- io
- logging
- poll
- random
- sockets
- wasmtime/src/component
- src/commands
- supply-chain
- tests/all
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
102 files changed
+5212
-4965
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | | - | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 14 | | |
26 | 15 | | |
27 | 16 | | |
| |||
40 | 29 | | |
41 | 30 | | |
42 | 31 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 32 | + | |
46 | 33 | | |
47 | 34 | | |
48 | 35 | | |
49 | 36 | | |
50 | | - | |
51 | | - | |
| 37 | + | |
| 38 | + | |
52 | 39 | | |
53 | 40 | | |
54 | 41 | | |
55 | 42 | | |
56 | 43 | | |
57 | | - | |
| 44 | + | |
58 | 45 | | |
59 | 46 | | |
60 | 47 | | |
61 | 48 | | |
62 | 49 | | |
63 | 50 | | |
64 | | - | |
| 51 | + | |
65 | 52 | | |
66 | 53 | | |
67 | 54 | | |
68 | 55 | | |
69 | | - | |
70 | | - | |
| 56 | + | |
| 57 | + | |
71 | 58 | | |
72 | 59 | | |
73 | 60 | | |
| |||
0 commit comments