forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split off wasmtime-wasi-io crate from wasmtime-wasi (bytecodealliance…
…#10036) * stub: wasmtime-wasi-io crate * wasmtime: component::ResourceTableError now impls core::error::Error for compatibility without std * relocate much of the wasi-io impl into wasmtime-wasi-io * stump of poll that uses in_tokio * finish moving instances over to wasmtime_wasi_io * redirect wasmtime_wasi's bindgen properly over to wasmtime_wasi_io * wasmtime-wasi-http: point directly at wasmtime_wasi_io in sources it worked without these changes because all the re-exports are in the right places, but this is nice to do * comment work * fix streams rename, migrate bindings to its own file * move wasi-io impls into their own mod with appropriate name. check in CI. * change ResourceTable::iter_entries from taking a HashMap to BTreeMap so it works without std * crate-level docs for wasmtime-wasi-io * more docs * more docs, wasi-io gives an add_to_linker function for async only * wasi-io: inline view into lib.rs. improve docs. * more streams vs stream fixes... * wasi-http stream->streams fixes * fix adding wasmtime-wasi-io to public crates * wasmtime-cli: drop overzealous `=` version constraint on wasmtime-wasi-http wasmtime-wasi-http is part of the public API where we guarantee semver is obeyed * fix doctest * mechanically rename the wasi-io pub traits, and resource types resource type Pollable -> DynPollable resource type InputStream -> DynInputStream resource type OutputStream -> DynOutputStream trait Subscribe -> Pollable trait HostInputStream -> InputStream trait HostOutputStream -> OutputStream type alias PollableFuture -> DynFuture (little-used) * delete unused ClosureFuture alias * doc fixes * wasmtime-wasi-http: use all of wasmtime-wasi-io through wasmtime-wasi re-exports * fix nostd build * missing separator. i love yml * make wasmtime-wasi-io #![no_std]
- Loading branch information
Showing
46 changed files
with
1,505 additions
and
817 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,10 @@ make_vendor() { | |
|
||
cache_dir=$(mktemp -d) | ||
|
||
make_vendor "wasi-io" " | ||
[email protected] | ||
" | ||
|
||
make_vendor "wasi" " | ||
[email protected] | ||
[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[package] | ||
name = "wasmtime-wasi-io" | ||
version.workspace = true | ||
authors.workspace = true | ||
description = "wasi-io common traits to be shared among other wasi implementations" | ||
license = "Apache-2.0 WITH LLVM-exception" | ||
categories = ["wasm"] | ||
keywords = ["webassembly", "wasm"] | ||
repository = "https://github.com/bytecodealliance/wasmtime" | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
wasmtime = { workspace = true, features = ["component-model", "async", "runtime"] } | ||
anyhow = { workspace = true } | ||
bytes = { workspace = true } | ||
async-trait = { workspace = true } | ||
futures = { workspace = true } | ||
|
||
[features] | ||
default = [ "std" ] | ||
std = [ | ||
"bytes/std", | ||
"anyhow/std", | ||
"wasmtime/std", | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
wasmtime::component::bindgen!({ | ||
path: "wit", | ||
trappable_imports: true, | ||
with: { | ||
"wasi:io/poll/pollable": crate::poll::DynPollable, | ||
"wasi:io/streams/input-stream": crate::streams::DynInputStream, | ||
"wasi:io/streams/output-stream": crate::streams::DynOutputStream, | ||
"wasi:io/error/error": crate::streams::Error, | ||
}, | ||
async: { | ||
only_imports: [ | ||
"poll", | ||
"[method]pollable.block", | ||
"[method]pollable.ready", | ||
"[method]input-stream.blocking-read", | ||
"[method]input-stream.blocking-skip", | ||
"[drop]input-stream", | ||
"[method]output-stream.blocking-splice", | ||
"[method]output-stream.blocking-flush", | ||
"[method]output-stream.blocking-write", | ||
"[method]output-stream.blocking-write-and-flush", | ||
"[method]output-stream.blocking-write-zeroes-and-flush", | ||
"[drop]output-stream", | ||
] | ||
}, | ||
trappable_error_type: { | ||
"wasi:io/streams/stream-error" => crate::streams::StreamError, | ||
} | ||
}); |
Oops, something went wrong.