Merge branch 'master' into dash-fixes-and-pthreads

This commit is contained in:
Johnathan Sharratt
2023-03-17 04:23:38 +11:00
72 changed files with 309 additions and 330 deletions

View File

@@ -898,7 +898,7 @@ Special thanks to [@ethanfrey](https://github.com/ethanfrey), [@AdamSLevy](https
- [#992](https://github.com/wasmerio/wasmer/pull/992) Updates WAPM version to 0.4.1, fix arguments issue introduced in #990 - [#992](https://github.com/wasmerio/wasmer/pull/992) Updates WAPM version to 0.4.1, fix arguments issue introduced in #990
- [#990](https://github.com/wasmerio/wasmer/pull/990) Default wasmer CLI to `run`. Wasmer will now attempt to parse unrecognized command line options as if they were applied to the run command: `wasmer mywasm.wasm --dir=.` now works! - [#990](https://github.com/wasmerio/wasmer/pull/990) Default wasmer CLI to `run`. Wasmer will now attempt to parse unrecognized command line options as if they were applied to the run command: `wasmer mywasm.wasm --dir=.` now works!
- [#987](https://github.com/wasmerio/wasmer/pull/987) Fix `runtime-c-api` header files when compiled by gnuc. - [#987](https://github.com/wasmerio/wasmer/pull/987) Fix `runtime-c-api` header files when compiled by gnuc.
- [#957](https://github.com/wasmerio/wasmer/pull/957) Change the meaning of `wasmer_wasi::is_wasi_module` to detect any type of WASI module, add support for new wasi snapshot_preview1 - [#957](https://github.com/wasmerio/wasmer/pull/957) Change the meaning of `wasmer_wasix::is_wasi_module` to detect any type of WASI module, add support for new wasi snapshot_preview1
- [#934](https://github.com/wasmerio/wasmer/pull/934) Simplify float expressions in the LLVM backend. - [#934](https://github.com/wasmerio/wasmer/pull/934) Simplify float expressions in the LLVM backend.
## 0.10.2 - 2019-11-18 ## 0.10.2 - 2019-11-18

130
Cargo.lock generated
View File

@@ -4515,6 +4515,43 @@ version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
[[package]]
name = "virtual-fs"
version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"bytes",
"derivative",
"filetime",
"fs_extra",
"getrandom",
"indexmap",
"lazy_static",
"libc",
"pin-project-lite",
"pretty_assertions",
"slab",
"tempfile",
"thiserror",
"tokio",
"tracing",
"typetag",
"webc",
]
[[package]]
name = "virtual-net"
version = "0.1.0"
dependencies = [
"async-trait",
"bytes",
"libc",
"thiserror",
"tokio",
"tracing",
]
[[package]] [[package]]
name = "void" name = "void"
version = "1.0.2" version = "1.0.2"
@@ -4944,6 +4981,7 @@ dependencies = [
"paste", "paste",
"thiserror", "thiserror",
"typetag", "typetag",
"virtual-fs",
"wasmer", "wasmer",
"wasmer-compiler", "wasmer-compiler",
"wasmer-compiler-cranelift", "wasmer-compiler-cranelift",
@@ -4953,8 +4991,7 @@ dependencies = [
"wasmer-inline-c", "wasmer-inline-c",
"wasmer-middlewares", "wasmer-middlewares",
"wasmer-types", "wasmer-types",
"wasmer-vfs", "wasmer-wasix",
"wasmer-wasi",
"webc", "webc",
] ]
@@ -5039,6 +5076,8 @@ dependencies = [
"tracing-subscriber 0.3.16", "tracing-subscriber 0.3.16",
"unix_mode", "unix_mode",
"url", "url",
"virtual-fs",
"virtual-net",
"walkdir", "walkdir",
"wasm-coredump-builder", "wasm-coredump-builder",
"wasmer", "wasmer",
@@ -5052,12 +5091,9 @@ dependencies = [
"wasmer-registry", "wasmer-registry",
"wasmer-toml", "wasmer-toml",
"wasmer-types", "wasmer-types",
"wasmer-vfs",
"wasmer-vm", "wasmer-vm",
"wasmer-vnet", "wasmer-wasix",
"wasmer-wasi", "wasmer-wasix-experimental-io-devices",
"wasmer-wasi-experimental-io-devices",
"wasmer-wasi-local-networking",
"wasmer-wasm-interface", "wasmer-wasm-interface",
"wasmer-wast", "wasmer-wast",
"wasmparser 0.51.4", "wasmparser 0.51.4",
@@ -5305,7 +5341,7 @@ dependencies = [
[[package]] [[package]]
name = "wasmer-sys-utils" name = "wasmer-sys-utils"
version = "3.2.0-alpha.1" version = "0.1.0"
dependencies = [ dependencies = [
"libc", "libc",
"region", "region",
@@ -5314,7 +5350,7 @@ dependencies = [
"wasmer", "wasmer",
"wasmer-types", "wasmer-types",
"wasmer-vm", "wasmer-vm",
"wasmer-wasi", "wasmer-wasix",
] ]
[[package]] [[package]]
@@ -5350,31 +5386,6 @@ dependencies = [
"thiserror", "thiserror",
] ]
[[package]]
name = "wasmer-vfs"
version = "3.2.0-alpha.1"
dependencies = [
"anyhow",
"async-trait",
"bytes",
"derivative",
"filetime",
"fs_extra",
"getrandom",
"indexmap",
"lazy_static",
"libc",
"pin-project-lite",
"pretty_assertions",
"slab",
"tempfile",
"thiserror",
"tokio",
"tracing",
"typetag",
"webc",
]
[[package]] [[package]]
name = "wasmer-vm" name = "wasmer-vm"
version = "3.2.0-alpha.1" version = "3.2.0-alpha.1"
@@ -5401,18 +5412,8 @@ dependencies = [
] ]
[[package]] [[package]]
name = "wasmer-vnet" name = "wasmer-wasix"
version = "3.2.0-alpha.1" version = "0.1.0"
dependencies = [
"async-trait",
"bytes",
"thiserror",
"tracing",
]
[[package]]
name = "wasmer-wasi"
version = "3.2.0-alpha.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@@ -5451,6 +5452,8 @@ dependencies = [
"tracing-wasm", "tracing-wasm",
"typetag", "typetag",
"urlencoding", "urlencoding",
"virtual-fs",
"virtual-net",
"wai-bindgen-wasmer", "wai-bindgen-wasmer",
"waker-fn", "waker-fn",
"wasm-bindgen", "wasm-bindgen",
@@ -5459,11 +5462,8 @@ dependencies = [
"wasmer-compiler", "wasmer-compiler",
"wasmer-emscripten", "wasmer-emscripten",
"wasmer-types", "wasmer-types",
"wasmer-vfs",
"wasmer-vm", "wasmer-vm",
"wasmer-vnet", "wasmer-wasix-types",
"wasmer-wasi-local-networking",
"wasmer-wasi-types",
"wcgi", "wcgi",
"wcgi-host", "wcgi-host",
"webc", "webc",
@@ -5472,8 +5472,8 @@ dependencies = [
] ]
[[package]] [[package]]
name = "wasmer-wasi-experimental-io-devices" name = "wasmer-wasix-experimental-io-devices"
version = "3.2.0-alpha.1" version = "0.1.0"
dependencies = [ dependencies = [
"minifb", "minifb",
"nix 0.25.1", "nix 0.25.1",
@@ -5481,25 +5481,13 @@ dependencies = [
"serde", "serde",
"tracing", "tracing",
"typetag", "typetag",
"wasmer-wasi", "wasmer-wasix",
"wasmer-wasi-types", "wasmer-wasix-types",
] ]
[[package]] [[package]]
name = "wasmer-wasi-local-networking" name = "wasmer-wasix-types"
version = "3.2.0-alpha.1" version = "0.1.0"
dependencies = [
"async-trait",
"bytes",
"libc",
"tokio",
"tracing",
"wasmer-vnet",
]
[[package]]
name = "wasmer-wasi-types"
version = "3.2.0-alpha.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bitflags", "bitflags",
@@ -5540,9 +5528,9 @@ dependencies = [
"tempfile", "tempfile",
"thiserror", "thiserror",
"tokio", "tokio",
"virtual-fs",
"wasmer", "wasmer",
"wasmer-vfs", "wasmer-wasix",
"wasmer-wasi",
"wast 38.0.1", "wast 38.0.1",
] ]
@@ -5574,7 +5562,7 @@ dependencies = [
"wasmer-emscripten", "wasmer-emscripten",
"wasmer-middlewares", "wasmer-middlewares",
"wasmer-types", "wasmer-types",
"wasmer-wasi", "wasmer-wasix",
"wasmer-wast", "wasmer-wast",
] ]

View File

@@ -18,7 +18,7 @@ wasmer-compiler-cranelift = { version = "=3.2.0-alpha.1", path = "lib/compiler-c
wasmer-compiler-singlepass = { version = "=3.2.0-alpha.1", path = "lib/compiler-singlepass", optional = true } wasmer-compiler-singlepass = { version = "=3.2.0-alpha.1", path = "lib/compiler-singlepass", optional = true }
wasmer-compiler-llvm = { version = "=3.2.0-alpha.1", path = "lib/compiler-llvm", optional = true } wasmer-compiler-llvm = { version = "=3.2.0-alpha.1", path = "lib/compiler-llvm", optional = true }
wasmer-emscripten = { version = "=3.2.0-alpha.1", path = "lib/emscripten", optional = true } wasmer-emscripten = { version = "=3.2.0-alpha.1", path = "lib/emscripten", optional = true }
wasmer-wasi = { version = "=3.2.0-alpha.1", path = "lib/wasi", optional = true } wasmer-wasix = { version = "0.1.0", path = "lib/wasi", optional = true }
wasmer-wast = { version = "=3.2.0-alpha.1", path = "tests/lib/wast", optional = true } wasmer-wast = { version = "=3.2.0-alpha.1", path = "tests/lib/wast", optional = true }
wasi-test-generator = { version = "=3.2.0-alpha.1", path = "tests/wasi-wast", optional = true } wasi-test-generator = { version = "=3.2.0-alpha.1", path = "tests/wasi-wast", optional = true }
wasmer-cache = { version = "=3.2.0-alpha.1", path = "lib/cache", optional = true } wasmer-cache = { version = "=3.2.0-alpha.1", path = "lib/cache", optional = true }
@@ -49,7 +49,6 @@ members = [
"lib/wasi", "lib/wasi",
"lib/wasi-types", "lib/wasi-types",
"lib/wasi-experimental-io-devices", "lib/wasi-experimental-io-devices",
"lib/wasi-local-networking",
"lib/wasix/wasix-http-client", "lib/wasix/wasix-http-client",
"lib/wasm-interface", "lib/wasm-interface",
"lib/c-api/tests/wasmer-c-api-test-runner", "lib/c-api/tests/wasmer-c-api-test-runner",
@@ -106,7 +105,7 @@ engine = ["universal"]
universal = [] universal = []
cache = ["wasmer-cache"] cache = ["wasmer-cache"]
wast = ["wasmer-wast"] wast = ["wasmer-wast"]
wasi = ["wasmer-wasi"] wasi = ["wasmer-wasix"]
emscripten = ["wasmer-emscripten"] emscripten = ["wasmer-emscripten"]
wat = ["wasmer/wat"] wat = ["wasmer/wat"]
compiler = ["wasmer/compiler", "wasmer-compiler/translator"] compiler = ["wasmer/compiler", "wasmer-compiler/translator"]

View File

@@ -18,7 +18,7 @@ use std::io::Read;
use wasmer::{Module, Store}; use wasmer::{Module, Store};
use wasmer_compiler_cranelift::Cranelift; use wasmer_compiler_cranelift::Cranelift;
use wasmer_wasi::{Pipe, WasiEnv}; use wasmer_wasix::{Pipe, WasiEnv};
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let wasm_path = concat!( let wasm_path = concat!(

View File

@@ -17,7 +17,7 @@
use wasmer::{Instance, Module, Store}; use wasmer::{Instance, Module, Store};
use wasmer_compiler_cranelift::Cranelift; use wasmer_compiler_cranelift::Cranelift;
use wasmer_wasi::WasiEnv; use wasmer_wasix::WasiEnv;
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let wasm_path = concat!( let wasm_path = concat!(

View File

@@ -14,7 +14,7 @@
use std::io::{Read, Write}; use std::io::{Read, Write};
use wasmer::{Module, Store}; use wasmer::{Module, Store};
use wasmer_compiler_cranelift::Cranelift; use wasmer_compiler_cranelift::Cranelift;
use wasmer_wasi::{Pipe, WasiEnv}; use wasmer_wasix::{Pipe, WasiEnv};
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let wasm_path = concat!( let wasm_path = concat!(

View File

@@ -29,9 +29,9 @@ wasmer-compiler-llvm = { version = "=3.2.0-alpha.1", path = "../compiler-llvm",
wasmer-emscripten = { version = "=3.2.0-alpha.1", path = "../emscripten", optional = true } wasmer-emscripten = { version = "=3.2.0-alpha.1", path = "../emscripten", optional = true }
wasmer-compiler = { version = "=3.2.0-alpha.1", path = "../compiler" } wasmer-compiler = { version = "=3.2.0-alpha.1", path = "../compiler" }
wasmer-middlewares = { version = "=3.2.0-alpha.1", path = "../middlewares", optional = true } wasmer-middlewares = { version = "=3.2.0-alpha.1", path = "../middlewares", optional = true }
wasmer-wasi = { version = "=3.2.0-alpha.1", path = "../wasi", features = ["host-fs", "host-vnet"], optional = true } wasmer-wasix = { version = "0.1.0", path = "../wasi", features = ["host-fs", "host-vnet"], optional = true }
wasmer-types = { version = "=3.2.0-alpha.1", path = "../types" } wasmer-types = { version = "=3.2.0-alpha.1", path = "../types" }
wasmer-vfs = { version = "=3.2.0-alpha.1", path = "../vfs", optional = true, default-features = false, features = ["static-fs"] } virtual-fs = { version = "0.1.0", path = "../vfs", optional = true, default-features = false, features = ["static-fs"] }
webc = { version = "5.0.0-rc.5", optional = true } webc = { version = "5.0.0-rc.5", optional = true }
enumset = "1.0.2" enumset = "1.0.2"
cfg-if = "1.0" cfg-if = "1.0"
@@ -59,7 +59,7 @@ default = [
"middlewares", "middlewares",
] ]
wat = ["wasmer-api/wat"] wat = ["wasmer-api/wat"]
wasi = ["wasmer-wasi"] wasi = ["wasmer-wasix"]
middlewares = [ middlewares = [
"compiler", "compiler",
"wasmer-middlewares", "wasmer-middlewares",
@@ -92,7 +92,7 @@ wasmer-artifact-load = ["wasmer-compiler/wasmer-artifact-load"]
wasmer-artifact-create = ["wasmer-compiler/wasmer-artifact-create"] wasmer-artifact-create = ["wasmer-compiler/wasmer-artifact-create"]
static-artifact-load = ["wasmer-compiler/static-artifact-load"] static-artifact-load = ["wasmer-compiler/static-artifact-load"]
static-artifact-create = ["wasmer-compiler/static-artifact-create"] static-artifact-create = ["wasmer-compiler/static-artifact-create"]
webc_runner = ["wasmer-wasi/webc_runner", "wasmer-vfs", "webc"] webc_runner = ["wasmer-wasix/webc_runner", "virtual-fs", "webc"]
# Deprecated features. # Deprecated features.
jit = ["compiler"] jit = ["compiler"]

View File

@@ -18,8 +18,8 @@ use std::os::raw::c_char;
use std::slice; use std::slice;
#[cfg(feature = "webc_runner")] #[cfg(feature = "webc_runner")]
use wasmer_api::{AsStoreMut, Imports, Module}; use wasmer_api::{AsStoreMut, Imports, Module};
use wasmer_wasi::{ use wasmer_wasix::{
default_fs_backing, get_wasi_version, wasmer_vfs::AsyncReadExt, Pipe, VirtualTaskManager, default_fs_backing, get_wasi_version, virtual_fs::AsyncReadExt, Pipe, VirtualTaskManager,
WasiEnv, WasiEnvBuilder, WasiFile, WasiFunctionEnv, WasiVersion, WasiEnv, WasiEnvBuilder, WasiFile, WasiFunctionEnv, WasiVersion,
}; };
@@ -248,7 +248,7 @@ fn prepare_webc_env(
len: usize, len: usize,
package_name: &str, package_name: &str,
) -> Option<(WasiFunctionEnv, Imports)> { ) -> Option<(WasiFunctionEnv, Imports)> {
use wasmer_vfs::static_fs::StaticFileSystem; use virtual_fs::static_fs::StaticFileSystem;
use webc::v1::{FsEntryType, WebC}; use webc::v1::{FsEntryType, WebC};
let slice = unsafe { std::slice::from_raw_parts(bytes, len) }; let slice = unsafe { std::slice::from_raw_parts(bytes, len) };

View File

@@ -32,16 +32,15 @@ wasmer-compiler-singlepass = { version = "=3.2.0-alpha.1", path = "../compiler-s
wasmer-compiler-llvm = { version = "=3.2.0-alpha.1", path = "../compiler-llvm", optional = true } wasmer-compiler-llvm = { version = "=3.2.0-alpha.1", path = "../compiler-llvm", optional = true }
wasmer-emscripten = { version = "=3.2.0-alpha.1", path = "../emscripten", optional = true } wasmer-emscripten = { version = "=3.2.0-alpha.1", path = "../emscripten", optional = true }
wasmer-vm = { version = "=3.2.0-alpha.1", path = "../vm" } wasmer-vm = { version = "=3.2.0-alpha.1", path = "../vm" }
wasmer-wasi = { version = "=3.2.0-alpha.1", path = "../wasi", optional = true } wasmer-wasix = { version = "0.1.0", path = "../wasi", optional = true }
wasmer-wasi-experimental-io-devices = { version = "=3.2.0-alpha.1", path = "../wasi-experimental-io-devices", optional = true, features = ["link_external_libs"] } wasmer-wasix-experimental-io-devices = { version = "0.1.0", path = "../wasi-experimental-io-devices", optional = true, features = ["link_external_libs"] }
wasmer-wasi-local-networking = { version = "=3.2.0-alpha.1", path = "../wasi-local-networking", optional = true }
wasmer-wast = { version = "=3.2.0-alpha.1", path = "../../tests/lib/wast", optional = true } wasmer-wast = { version = "=3.2.0-alpha.1", path = "../../tests/lib/wast", optional = true }
wasmer-cache = { version = "=3.2.0-alpha.1", path = "../cache", optional = true } wasmer-cache = { version = "=3.2.0-alpha.1", path = "../cache", optional = true }
wasmer-types = { version = "=3.2.0-alpha.1", path = "../types", features = ["enable-serde"] } wasmer-types = { version = "=3.2.0-alpha.1", path = "../types", features = ["enable-serde"] }
wasmer-registry = { version = "=4.0.0", path = "../registry" } wasmer-registry = { version = "=4.0.0", path = "../registry" }
wasmer-object = { version = "=3.2.0-alpha.1", path = "../object", optional = true } wasmer-object = { version = "=3.2.0-alpha.1", path = "../object", optional = true }
wasmer-vfs = { version = "=3.2.0-alpha.1", path = "../vfs", default-features = false, features = ["host-fs"] } virtual-fs = { version = "0.1.0", path = "../vfs", default-features = false, features = ["host-fs"] }
wasmer-vnet = { version = "=3.2.0-alpha.1", path = "../vnet" } virtual-net = { version = "0.1.0", path = "../vnet" }
wasmer-wasm-interface = { version = "3.2.0-alpha.1", path = "../wasm-interface" } wasmer-wasm-interface = { version = "3.2.0-alpha.1", path = "../wasm-interface" }
wasmparser = "0.51.4" wasmparser = "0.51.4"
atty = "0.2" atty = "0.2"
@@ -116,14 +115,23 @@ default = [
cache = ["wasmer-cache"] cache = ["wasmer-cache"]
cache-blake3-pure = ["wasmer-cache/blake3-pure"] cache-blake3-pure = ["wasmer-cache/blake3-pure"]
wast = ["wasmer-wast"] wast = ["wasmer-wast"]
wasi = ["wasmer-wasi", "wasmer-wasi-local-networking"] wasi = ["wasmer-wasix", "host-net"]
host-net = [ "virtual-net/host-net" ]
emscripten = ["wasmer-emscripten"] emscripten = ["wasmer-emscripten"]
wat = ["wasmer/wat"] wat = ["wasmer/wat"]
webc_runner = ["wasi", "wasmer-wasi/webc_runner", "wasmer-wasi/webc_runner_rt_wasi", "wasmer-wasi/webc_runner_rt_wcgi", "wasmer-wasi/webc_runner_rt_emscripten", "nuke-dir", "webc"] webc_runner = [
"wasi",
"wasmer-wasix/webc_runner",
"wasmer-wasix/webc_runner_rt_wasi",
"wasmer-wasix/webc_runner_rt_wcgi",
"wasmer-wasix/webc_runner_rt_emscripten",
"nuke-dir",
"webc"
]
compiler = [ compiler = [
"wasmer-compiler/translator", "wasmer-compiler/translator",
"wasmer-compiler/compiler", "wasmer-compiler/compiler",
"wasmer-wasi/compiler" "wasmer-wasix/compiler"
] ]
wasmer-artifact-create = ["compiler", wasmer-artifact-create = ["compiler",
"wasmer/wasmer-artifact-load", "wasmer/wasmer-artifact-load",
@@ -149,7 +157,7 @@ static-artifact-load = ["compiler",
] ]
experimental-io-devices = [ experimental-io-devices = [
"wasmer-wasi-experimental-io-devices", "wasmer-wasix-experimental-io-devices",
"wasi" "wasi"
] ]
singlepass = [ singlepass = [
@@ -164,8 +172,8 @@ llvm = [
"wasmer-compiler-llvm", "wasmer-compiler-llvm",
"compiler", "compiler",
] ]
debug = ["tracing", "wasmer-wasi/logging"] debug = ["tracing", "wasmer-wasix/logging"]
disable-all-logging = ["wasmer-wasi/disable-all-logging", "log/release_max_level_off"] disable-all-logging = ["wasmer-wasix/disable-all-logging", "log/release_max_level_off"]
headless = [] headless = []
headless-minimal = ["headless", "disable-all-logging", "wasi"] headless-minimal = ["headless", "disable-all-logging", "wasi"]
tracing = [ "dep:tracing", "tracing-subscriber" ] tracing = [ "dep:tracing", "tracing-subscriber" ]
@@ -175,7 +183,7 @@ enable-serde = [
"wasmer/enable-serde", "wasmer/enable-serde",
"wasmer-vm/enable-serde", "wasmer-vm/enable-serde",
"wasmer-compiler/enable-serde", "wasmer-compiler/enable-serde",
"wasmer-wasi/enable-serde", "wasmer-wasix/enable-serde",
] ]
[target.'cfg(target_os = "windows")'.dependencies] [target.'cfg(target_os = "windows")'.dependencies]

View File

@@ -21,7 +21,7 @@ use wasmer::*;
use wasmer_cache::{Cache, FileSystemCache, Hash}; use wasmer_cache::{Cache, FileSystemCache, Hash};
use wasmer_types::Type as ValueType; use wasmer_types::Type as ValueType;
#[cfg(feature = "webc_runner")] #[cfg(feature = "webc_runner")]
use wasmer_wasi::runners::{Runner, WapmContainer}; use wasmer_wasix::runners::{Runner, WapmContainer};
#[cfg(feature = "wasi")] #[cfg(feature = "wasi")]
mod wasi; mod wasi;
@@ -288,7 +288,7 @@ impl RunWithPathBuf {
#[cfg(feature = "wasi")] #[cfg(feature = "wasi")]
let ret = { let ret = {
use std::collections::BTreeSet; use std::collections::BTreeSet;
use wasmer_wasi::WasiVersion; use wasmer_wasix::WasiVersion;
let wasi_versions = Wasi::get_versions(&module); let wasi_versions = Wasi::get_versions(&module);
match wasi_versions { match wasi_versions {
@@ -393,14 +393,14 @@ impl RunWithPathBuf {
.with_context(|| format!("No metadata found for the command, \"{id}\""))?; .with_context(|| format!("No metadata found for the command, \"{id}\""))?;
let (store, _compiler_type) = self.store.get_store()?; let (store, _compiler_type) = self.store.get_store()?;
let mut runner = wasmer_wasi::runners::wasi::WasiRunner::new(store); let mut runner = wasmer_wasix::runners::wasi::WasiRunner::new(store);
runner.set_args(args.to_vec()); runner.set_args(args.to_vec());
if runner.can_run_command(id, command).unwrap_or(false) { if runner.can_run_command(id, command).unwrap_or(false) {
return runner.run_cmd(&container, id).context("WASI runner failed"); return runner.run_cmd(&container, id).context("WASI runner failed");
} }
let (store, _compiler_type) = self.store.get_store()?; let (store, _compiler_type) = self.store.get_store()?;
let mut runner = wasmer_wasi::runners::emscripten::EmscriptenRunner::new(store); let mut runner = wasmer_wasix::runners::emscripten::EmscriptenRunner::new(store);
runner.set_args(args.to_vec()); runner.set_args(args.to_vec());
if runner.can_run_command(id, command).unwrap_or(false) { if runner.can_run_command(id, command).unwrap_or(false) {
return runner return runner
@@ -408,7 +408,7 @@ impl RunWithPathBuf {
.context("Emscripten runner failed"); .context("Emscripten runner failed");
} }
let mut runner = wasmer_wasi::runners::wcgi::WcgiRunner::new(id); let mut runner = wasmer_wasix::runners::wcgi::WcgiRunner::new(id);
let (store, _compiler_type) = self.store.get_store()?; let (store, _compiler_type) = self.store.get_store()?;
runner runner
.config() .config()

View File

@@ -4,13 +4,13 @@ use std::collections::HashMap;
use std::path::PathBuf; use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
use std::{collections::BTreeSet, path::Path}; use std::{collections::BTreeSet, path::Path};
use virtual_fs::FileSystem;
use virtual_fs::{DeviceFile, PassthruFileSystem, RootFileSystemBuilder};
use wasmer::{AsStoreMut, Instance, Module, RuntimeError, Value}; use wasmer::{AsStoreMut, Instance, Module, RuntimeError, Value};
use wasmer_vfs::FileSystem; use wasmer_wasix::os::tty_sys::SysTty;
use wasmer_vfs::{DeviceFile, PassthruFileSystem, RootFileSystemBuilder}; use wasmer_wasix::os::TtyBridge;
use wasmer_wasi::os::tty_sys::SysTyy; use wasmer_wasix::types::__WASI_STDIN_FILENO;
use wasmer_wasi::os::TtyBridge; use wasmer_wasix::{
use wasmer_wasi::types::__WASI_STDIN_FILENO;
use wasmer_wasi::{
default_fs_backing, get_wasi_versions, PluggableRuntimeImplementation, WasiEnv, WasiError, default_fs_backing, get_wasi_versions, PluggableRuntimeImplementation, WasiEnv, WasiError,
WasiFunctionEnv, WasiVersion, WasiFunctionEnv, WasiVersion,
}; };
@@ -132,15 +132,13 @@ impl Wasi {
let mut rt = PluggableRuntimeImplementation::default(); let mut rt = PluggableRuntimeImplementation::default();
if self.networking { if self.networking {
rt.set_networking_implementation( rt.set_networking_implementation(virtual_net::host::LocalNetworking::default());
wasmer_wasi_local_networking::LocalNetworking::default(),
);
} else { } else {
rt.set_networking_implementation(wasmer_vnet::UnsupportedVirtualNetworking::default()); rt.set_networking_implementation(virtual_net::UnsupportedVirtualNetworking::default());
} }
if !self.no_tty { if !self.no_tty {
let tty = Arc::new(SysTyy::default()); let tty = Arc::new(SysTty::default());
tty.reset(); tty.reset();
rt.set_tty(tty) rt.set_tty(tty)
} }
@@ -156,7 +154,7 @@ impl Wasi {
.include_webcs(self.include_webcs.clone()) .include_webcs(self.include_webcs.clone())
.map_commands(map_commands); .map_commands(map_commands);
let mut builder = if wasmer_wasi::is_wasix_module(module) { let mut builder = if wasmer_wasix::is_wasix_module(module) {
// If we preopen anything from the host then shallow copy it over // If we preopen anything from the host then shallow copy it over
let root_fs = RootFileSystemBuilder::new() let root_fs = RootFileSystemBuilder::new()
.with_tty(Box::new(DeviceFile::new(__WASI_STDIN_FILENO))) .with_tty(Box::new(DeviceFile::new(__WASI_STDIN_FILENO)))
@@ -187,7 +185,7 @@ impl Wasi {
}; };
if self.http_client { if self.http_client {
let caps = wasmer_wasi::http::HttpClientCapabilityV1::new_allow_all(); let caps = wasmer_wasix::http::HttpClientCapabilityV1::new_allow_all();
builder.capabilities_mut().http_client = caps; builder.capabilities_mut().http_client = caps;
} }

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-sys-utils" name = "wasmer-sys-utils"
version = "3.2.0-alpha.1" version = "0.1.0"
description = "Wasmer utilities for a sys environment." description = "Wasmer utilities for a sys environment."
categories = ["wasm"] categories = ["wasm"]
keywords = ["wasm", "webassembly"] keywords = ["wasm", "webassembly"]
@@ -19,7 +19,7 @@ region = { version = "3.0" }
libc = { version = "^0.2", default-features = false } libc = { version = "^0.2", default-features = false }
[dev-dependencies] [dev-dependencies]
wasmer-wasi = { path = "../wasi", version = "=3.2.0-alpha.1" } wasmer-wasix = { path = "../wasi", version = "0.1.0" }
wasmer = { path = "../api", version = "=3.2.0-alpha.1", default-features = false, features = ["sys", "compiler", "cranelift"] } wasmer = { path = "../api", version = "=3.2.0-alpha.1", default-features = false, features = ["sys", "compiler", "cranelift"] }
tracing-subscriber = { version = "0.3.16", features = ["fmt"] } tracing-subscriber = { version = "0.3.16", features = ["fmt"] }
tracing = "0.1.37" tracing = "0.1.37"

View File

@@ -3,8 +3,8 @@
// use wasmer::{BaseTunables, Engine, Module, Store, Tunables}; // use wasmer::{BaseTunables, Engine, Module, Store, Tunables};
// use wasmer_vm::VMMemory; // use wasmer_vm::VMMemory;
// use wasmer_wasi::{ // use wasmer_wasix::{
// bin_factory::spawn_exec_module, wasmer_vfs::host_fs::File, BusSpawnedProcessJoin, // bin_factory::spawn_exec_module, virtual_fs::host_fs::File, BusSpawnedProcessJoin,
// PluggableRuntimeImplementation, WasiControlPlane, WasiEnv, WasiRuntime, // PluggableRuntimeImplementation, WasiControlPlane, WasiEnv, WasiRuntime,
// WasiState, // WasiState,
// }; // };
@@ -101,9 +101,9 @@
// // .clone(); // // .clone();
// // Generate an `ImportObject`. // // Generate an `ImportObject`.
// // let instance = wasmer_wasi::build_wasi_instance(&module, &mut wasi_env, &mut store).unwrap(); // // let instance = wasmer_wasix::build_wasi_instance(&module, &mut wasi_env, &mut store).unwrap();
// let config = wasmer_wasi::wasmer_vbus::SpawnOptionsConfig { // let config = wasmer_wasix::wasmer_vbus::SpawnOptionsConfig {
// reuse: false, // reuse: false,
// env: wasi_env.data(&store).clone(), // env: wasi_env.data(&store).clone(),
// remote_instance: None, // remote_instance: None,

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-vfs" name = "virtual-fs"
version = "3.2.0-alpha.1" version = "0.1.0"
description = "Wasmer Virtual FileSystem" description = "Wasmer Virtual FileSystem"
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
license = "MIT" license = "MIT"

View File

@@ -26,7 +26,7 @@ use crate::{
/// might do something like this: /// might do something like this:
/// ///
/// ```rust /// ```rust
/// use wasmer_vfs::{ /// use virtual_fs::{
/// mem_fs::FileSystem as MemFS, /// mem_fs::FileSystem as MemFS,
/// host_fs::FileSystem as HostFS, /// host_fs::FileSystem as HostFS,
/// OverlayFileSystem, /// OverlayFileSystem,

View File

@@ -311,7 +311,7 @@ impl FileSystem for UnionFileSystem {
Err(err) => { Err(err) => {
// This fixes a bug when attempting to create the directory /usr when it does not exist // This fixes a bug when attempting to create the directory /usr when it does not exist
// on the x86 version of memfs // on the x86 version of memfs
// TODO: patch wasmer_vfs and remove // TODO: patch virtual-fs and remove
if let FsError::NotAFile = &err { if let FsError::NotAFile = &err {
ret_error = FsError::EntryNotFound; ret_error = FsError::EntryNotFound;
} else { } else {
@@ -335,7 +335,7 @@ impl FileSystem for UnionFileSystem {
Err(err) => { Err(err) => {
// This fixes a bug when attempting to create the directory /usr when it does not exist // This fixes a bug when attempting to create the directory /usr when it does not exist
// on the x86 version of memfs // on the x86 version of memfs
// TODO: patch wasmer_vfs and remove // TODO: patch virtual-fs and remove
if let FsError::NotAFile = &err { if let FsError::NotAFile = &err {
ret_error = FsError::EntryNotFound; ret_error = FsError::EntryNotFound;
} else { } else {

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-vnet" name = "virtual-net"
version = "3.2.0-alpha.1" version = "0.1.0"
description = "Wasmer Virtual Networking" description = "Wasmer Virtual Networking"
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
license = "MIT" license = "MIT"
@@ -8,6 +8,11 @@ edition = "2018"
[dependencies] [dependencies]
thiserror = "1" thiserror = "1"
bytes = "1" bytes = "1.1"
async-trait = { version = "^0.1" } async-trait = { version = "^0.1" }
tracing = "0.1" tracing = "0.1"
tokio = { version = "1", features = [ "sync", "macros", "io-util", "signal" ], default_features = false, optional = true }
libc = { version = "0.2.139", optional = true }
[features]
host-net = [ "tokio", "libc" ]

View File

@@ -1,4 +1,10 @@
#![allow(unused_variables)] #![allow(unused_variables)]
#[allow(unused_imports)]
use crate::{
IpCidr, IpRoute, NetworkError, Result, SocketStatus, StreamSecurity, VirtualConnectedSocket,
VirtualConnectionlessSocket, VirtualIcmpSocket, VirtualNetworking, VirtualRawSocket,
VirtualSocket, VirtualTcpListener, VirtualTcpSocket, VirtualUdpSocket,
};
use std::future::Future; use std::future::Future;
use std::mem::MaybeUninit; use std::mem::MaybeUninit;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr}; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr};
@@ -10,12 +16,6 @@ use std::time::Duration;
use tokio::sync::mpsc; use tokio::sync::mpsc;
#[allow(unused_imports, dead_code)] #[allow(unused_imports, dead_code)]
use tracing::{debug, error, info, trace, warn}; use tracing::{debug, error, info, trace, warn};
#[allow(unused_imports)]
use wasmer_vnet::{
IpCidr, IpRoute, NetworkError, Result, SocketStatus, StreamSecurity, VirtualConnectedSocket,
VirtualConnectionlessSocket, VirtualIcmpSocket, VirtualNetworking, VirtualRawSocket,
VirtualSocket, VirtualTcpListener, VirtualTcpSocket, VirtualUdpSocket,
};
#[derive(Debug)] #[derive(Debug)]
pub struct LocalNetworking { pub struct LocalNetworking {

View File

@@ -529,3 +529,6 @@ pub enum NetworkError {
#[error("unknown error found")] #[error("unknown error found")]
UnknownError, UnknownError,
} }
#[cfg(feature = "host-net")]
pub mod host;

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "wasmer-wasi-experimental-io-devices" name = "wasmer-wasix-experimental-io-devices"
version = "3.2.0-alpha.1" version = "0.1.0"
description = "An experimental non-standard WASI extension for graphics" description = "An experimental non-standard WASI/WASIX extension for graphics"
categories = ["wasm"] categories = ["wasm"]
keywords = ["wasm", "webassembly", "types"] keywords = ["wasm", "webassembly", "types"]
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
@@ -14,8 +14,8 @@ edition = "2018"
maintenance = { status = "experimental" } maintenance = { status = "experimental" }
[dependencies] [dependencies]
wasmer-wasi = { version = "=3.2.0-alpha.1", path = "../wasi", default-features=false } wasmer-wasix = { version = "0.1.0", path = "../wasi", default-features=false }
wasmer-wasi-types = { path = "../wasi-types", version = "=3.2.0-alpha.1" } wasmer-wasix-types = { path = "../wasi-types", version = "0.1.0" }
tracing = "0.1" tracing = "0.1"
minifb = { version = "0.24.0", optional = true } minifb = { version = "0.24.0", optional = true }
nix = "0.25.0" nix = "0.25.0"
@@ -25,10 +25,10 @@ typetag = "0.1"
[features] [features]
default = [ default = [
"wasmer-wasi/default" "wasmer-wasix/default"
] ]
enable-serde = [ enable-serde = [
"wasmer-wasi/enable-serde" "wasmer-wasix/enable-serde"
] ]
# This feature exists, so that "cargo build --all" doesn't # This feature exists, so that "cargo build --all" doesn't
# accidentally link libxcbcommon and libwayland into the CLI # accidentally link libxcbcommon and libwayland into the CLI

View File

@@ -6,9 +6,9 @@ pub mod link_ext;
pub use crate::link_ext::*; pub use crate::link_ext::*;
#[cfg(not(feature = "link_external_libs"))] #[cfg(not(feature = "link_external_libs"))]
use wasmer_wasi::fs::WasiFs; use wasmer_wasix::fs::WasiFs;
#[cfg(not(feature = "link_external_libs"))] #[cfg(not(feature = "link_external_libs"))]
use wasmer_wasi::fs::WasiInodes; use wasmer_wasix::fs::WasiInodes;
#[cfg(not(feature = "link_external_libs"))] #[cfg(not(feature = "link_external_libs"))]
pub fn initialize(_: &WasiInodes, _: &mut WasiFs) -> Result<(), String> { pub fn initialize(_: &WasiInodes, _: &mut WasiFs) -> Result<(), String> {

View File

@@ -5,9 +5,9 @@ use std::collections::{BTreeSet, VecDeque};
use std::convert::TryInto; use std::convert::TryInto;
use std::io::{Read, Seek, SeekFrom, Write}; use std::io::{Read, Seek, SeekFrom, Write};
use tracing::debug; use tracing::debug;
use wasmer_wasi::types::{wasi::Filesize, *}; use wasmer_wasix::types::{wasi::Filesize, *};
use wasmer_wasi::{VirtualFile, WasiFsError, ALL_RIGHTS}; use wasmer_wasix::{VirtualFile, WasiFsError, ALL_RIGHTS};
use wasmer_wasi_types::wasi::Fdflags; use wasmer_wasix_types::wasi::Fdflags;
use minifb::{Key, KeyRepeat, MouseButton, Scale, Window, WindowOptions}; use minifb::{Key, KeyRepeat, MouseButton, Scale, Window, WindowOptions};
@@ -16,8 +16,8 @@ mod util;
use util::*; use util::*;
use std::cell::RefCell; use std::cell::RefCell;
use wasmer_wasi::os::fs::fd::Fd; use wasmer_wasix::os::fs::fd::Fd;
use wasmer_wasi::os::fs::{WasiFs, WasiInodes, VIRTUAL_ROOT_FD}; use wasmer_wasix::os::fs::{WasiFs, WasiInodes, VIRTUAL_ROOT_FD};
std::thread_local! { std::thread_local! {
pub(crate) static FRAMEBUFFER_STATE: RefCell<FrameBufferState> = pub(crate) static FRAMEBUFFER_STATE: RefCell<FrameBufferState> =
RefCell::new(FrameBufferState::new() RefCell::new(FrameBufferState::new()

View File

@@ -1,22 +0,0 @@
[package]
name = "wasmer-wasi-local-networking"
version = "3.2.0-alpha.1"
description = "An WASIX extension for local networking"
categories = ["wasm"]
keywords = ["wasm", "webassembly", "types"]
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
repository = "https://github.com/wasmerio/wasmer"
license = "MIT"
readme = "README.md"
edition = "2018"
[badges]
maintenance = { status = "experimental" }
[dependencies]
wasmer-vnet = { version = "=3.2.0-alpha.1", path = "../vnet" }
tracing = "0.1"
bytes = "1.1"
tokio = { version = "1", features = [ "sync", "macros", "io-util", "signal" ], default_features = false }
async-trait = { version = "^0.1" }
libc = "0.2.139"

View File

@@ -1 +0,0 @@
This is experimental extension of WASIX for networking.

View File

@@ -1,9 +1,9 @@
[package] [package]
name = "wasmer-wasi-types" name = "wasmer-wasix-types"
version = "3.2.0-alpha.1" version = "0.1.0"
description = "WASI types for Wasmer WebAssembly runtime" description = "WASI and WASIX types for Wasmer WebAssembly runtime"
categories = ["wasm", "os"] categories = ["wasm", "os"]
keywords = ["wasm", "webassembly", "wasi", "sandbox", "ABI"] keywords = ["wasm", "webassembly", "wasi", "wasix", "sandbox", "ABI"]
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
repository = "https://github.com/wasmerio/wasmer" repository = "https://github.com/wasmerio/wasmer"
license = "MIT" license = "MIT"

View File

@@ -1,9 +1,9 @@
[package] [package]
name = "wasmer-wasi" name = "wasmer-wasix"
version = "3.2.0-alpha.1" version = "0.1.0"
description = "WASI implementation library for Wasmer WebAssembly runtime" description = "WASI and WASIX implementation library for Wasmer WebAssembly runtime"
categories = ["wasm", "os"] categories = ["wasm", "os"]
keywords = ["wasm", "webassembly", "wasi", "sandbox", "ABI"] keywords = ["wasm", "webassembly", "wasi", "wasix", "sandbox", "ABI"]
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
repository = "https://github.com/wasmerio/wasmer" repository = "https://github.com/wasmerio/wasmer"
license = "MIT" license = "MIT"
@@ -15,13 +15,12 @@ cfg-if = "1.0"
thiserror = "1" thiserror = "1"
tracing = { version = "0.1" } tracing = { version = "0.1" }
getrandom = "0.2" getrandom = "0.2"
wasmer-wasi-types = { path = "../wasi-types", version = "=3.2.0-alpha.1" } wasmer-wasix-types = { path = "../wasi-types", version = "0.1.0" }
wasmer-types = { path = "../types", version = "=3.2.0-alpha.1", default-features = false } wasmer-types = { path = "../types", version = "=3.2.0-alpha.1", default-features = false }
wasmer = { path = "../api", version = "=3.2.0-alpha.1", default-features = false, features = ["wat", "js-serializable-module","tracing"] } wasmer = { path = "../api", version = "=3.2.0-alpha.1", default-features = false, features = ["wat", "js-serializable-module"] }
wasmer-vfs = { path = "../vfs", version = "=3.2.0-alpha.1", default-features = false, features = ["webc-fs"] }
wasmer-vm = { path = "../vm", version = "=3.2.0-alpha.1", optional = true } wasmer-vm = { path = "../vm", version = "=3.2.0-alpha.1", optional = true }
wasmer-vnet = { path = "../vnet", version = "=3.2.0-alpha.1", default-features = false } virtual-fs = { path = "../vfs", version = "0.1.0", default-features = false, features = ["webc-fs"] }
wasmer-wasi-local-networking = { path = "../wasi-local-networking", version = "=3.2.0-alpha.1", default-features = false, optional = true } virtual-net = { path = "../vnet", version = "0.1.0", default-features = false }
wasmer-emscripten = { path = "../emscripten", version = "=3.2.0-alpha.1", optional = true } wasmer-emscripten = { path = "../emscripten", version = "=3.2.0-alpha.1", optional = true }
typetag = { version = "0.1", optional = true } typetag = { version = "0.1", optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0", default-features = false, features = ["derive"] }
@@ -100,21 +99,21 @@ webc_runner_rt_wasi = []
webc_runner_rt_wcgi = ["hyper", "wcgi", "wcgi-host"] webc_runner_rt_wcgi = ["hyper", "wcgi", "wcgi-host"]
webc_runner_rt_emscripten = ["wasmer-emscripten"] webc_runner_rt_emscripten = ["wasmer-emscripten"]
sys = ["wasmer/sys", "wasmer-wasi-types/sys", "webc/mmap", "wasmer-vm", "time"] sys = ["wasmer/sys", "wasmer-wasix-types/sys", "webc/mmap", "wasmer-vm", "time"]
sys-default = ["wasmer/wat", "wasmer/compiler", "sys", "logging", "host-fs", "sys-poll", "sys-thread", "host-vnet", "host-threads", "host-reqwest" ] sys-default = ["wasmer/wat", "wasmer/compiler", "sys", "logging", "host-fs", "sys-poll", "sys-thread", "host-vnet", "host-threads", "host-reqwest" ]
sys-poll = [] sys-poll = []
sys-thread = ["tokio/rt", "tokio/time", "tokio/rt-multi-thread"] sys-thread = ["tokio/rt", "tokio/time", "tokio/rt-multi-thread"]
compiler = [ "wasmer/compiler", "wasmer-compiler"] compiler = [ "wasmer/compiler", "wasmer-compiler"]
js = ["wasmer/js", "wasmer-vfs/no-time", "getrandom/js", "chrono", "wasmer-wasi-types/js"] js = ["wasmer/js", "virtual-fs/no-time", "getrandom/js", "chrono", "wasmer-wasix-types/js"]
js-default = ["js", "wasmer/js-default"] js-default = ["js", "wasmer/js-default"]
test-js = ["js", "wasmer/js-default", "wasmer/wat"] test-js = ["js", "wasmer/js-default", "wasmer/wat"]
host-vnet = [ "wasmer-wasi-local-networking" ] host-vnet = [ "virtual-net/host-net" ]
host-threads = [] host-threads = []
host-reqwest = ["reqwest"] host-reqwest = ["reqwest"]
host-fs = ["wasmer-vfs/host-fs"] host-fs = ["virtual-fs/host-fs"]
logging = ["tracing/log"] logging = ["tracing/log"]
disable-all-logging = [ disable-all-logging = [
@@ -123,7 +122,7 @@ disable-all-logging = [
] ]
enable-serde = [ enable-serde = [
"typetag", "typetag",
"wasmer-vfs/enable-serde", "virtual-fs/enable-serde",
"wasmer-wasi-types/enable-serde", "wasmer-wasix-types/enable-serde",
] ]

View File

@@ -61,7 +61,7 @@ Hello, Some("Gordon")
```rust ```rust
use wasmer::{Store, Module, Instance}; use wasmer::{Store, Module, Instance};
use wasmer_wasi::WasiState; use wasmer_wasix::WasiState;
let mut store = Store::default(); let mut store = Store::default();
let module = Module::from_file(&store, "hello.wasm")?; let module = Module::from_file(&store, "hello.wasm")?;

View File

@@ -6,8 +6,8 @@ use std::{
}; };
use derivative::*; use derivative::*;
use wasmer_vfs::{FileSystem, TmpFileSystem}; use virtual_fs::{FileSystem, TmpFileSystem};
use wasmer_wasi_types::wasi::Snapshot0Clockid; use wasmer_wasix_types::wasi::Snapshot0Clockid;
use super::hash_of_binary; use super::hash_of_binary;
use crate::syscalls::platform_clock_time_get; use crate::syscalls::platform_clock_time_get;

View File

@@ -9,7 +9,7 @@ use tracing::*;
#[cfg(feature = "sys")] #[cfg(feature = "sys")]
use wasmer::NativeEngineExt; use wasmer::NativeEngineExt;
use wasmer::{FunctionEnvMut, Instance, Memory, Module, Store}; use wasmer::{FunctionEnvMut, Instance, Memory, Module, Store};
use wasmer_wasi_types::wasi::Errno; use wasmer_wasix_types::wasi::Errno;
use super::{BinFactory, BinaryPackage, ModuleCache}; use super::{BinFactory, BinaryPackage, ModuleCache};
use crate::{ use crate::{

View File

@@ -4,7 +4,7 @@ use std::{
sync::{Arc, RwLock}, sync::{Arc, RwLock},
}; };
use wasmer_vfs::{AsyncReadExt, FileSystem}; use virtual_fs::{AsyncReadExt, FileSystem};
mod binary_package; mod binary_package;
mod exec; mod exec;

View File

@@ -7,7 +7,7 @@ use std::{
}; };
use wasmer::Module; use wasmer::Module;
use wasmer_wasi_types::wasi::Snapshot0Clockid; use wasmer_wasix_types::wasi::Snapshot0Clockid;
use super::BinaryPackage; use super::BinaryPackage;
use crate::{syscalls::platform_clock_time_get, WasiRuntime}; use crate::{syscalls::platform_clock_time_get, WasiRuntime};

View File

@@ -7,8 +7,8 @@ use std::{
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use wasmer_vfs::{Pipe, VirtualFile}; use virtual_fs::{Pipe, VirtualFile};
use wasmer_wasi_types::wasi::{Fd as WasiFd, Fdflags, Filestat, Rights}; use wasmer_wasix_types::wasi::{Fd as WasiFd, Fdflags, Filestat, Rights};
use crate::net::socket::InodeSocket; use crate::net::socket::InodeSocket;

View File

@@ -9,9 +9,9 @@ use std::{
}; };
use tokio::io::{AsyncRead, AsyncSeek, AsyncWrite}; use tokio::io::{AsyncRead, AsyncSeek, AsyncWrite};
use wasmer_vfs::{FsError, VirtualFile}; use virtual_fs::{FsError, VirtualFile};
use wasmer_vnet::NetworkError; use virtual_net::NetworkError;
use wasmer_wasi_types::{ use wasmer_wasix_types::{
types::Eventtype, types::Eventtype,
wasi, wasi,
wasi::{Errno, Event, EventFdReadwrite, EventUnion, Eventrwflags, Subscription}, wasi::{Errno, Event, EventFdReadwrite, EventUnion, Eventrwflags, Subscription},

View File

@@ -18,8 +18,8 @@ use crate::state::{Stderr, Stdin, Stdout};
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use tokio::io::AsyncWriteExt; use tokio::io::AsyncWriteExt;
use tracing::{debug, trace}; use tracing::{debug, trace};
use wasmer_vfs::{FileSystem, FsError, OpenOptions, VirtualFile}; use virtual_fs::{FileSystem, FsError, OpenOptions, VirtualFile};
use wasmer_wasi_types::{ use wasmer_wasix_types::{
types::{__WASI_STDERR_FILENO, __WASI_STDIN_FILENO, __WASI_STDOUT_FILENO}, types::{__WASI_STDERR_FILENO, __WASI_STDIN_FILENO, __WASI_STDOUT_FILENO},
wasi::{ wasi::{
Errno, Fd as WasiFd, Fdflags, Fdstat, Filesize, Filestat, Filetype, Preopentype, Prestat, Errno, Fd as WasiFd, Fdflags, Fdstat, Filesize, Filestat, Filetype, Preopentype, Prestat,
@@ -264,48 +264,48 @@ impl Default for WasiInodes {
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub enum WasiFsRoot { pub enum WasiFsRoot {
Sandbox(Arc<wasmer_vfs::tmp_fs::TmpFileSystem>), Sandbox(Arc<virtual_fs::tmp_fs::TmpFileSystem>),
Backing(Arc<Box<dyn FileSystem>>), Backing(Arc<Box<dyn FileSystem>>),
} }
impl FileSystem for WasiFsRoot { impl FileSystem for WasiFsRoot {
fn read_dir(&self, path: &Path) -> wasmer_vfs::Result<wasmer_vfs::ReadDir> { fn read_dir(&self, path: &Path) -> virtual_fs::Result<virtual_fs::ReadDir> {
match self { match self {
WasiFsRoot::Sandbox(fs) => fs.read_dir(path), WasiFsRoot::Sandbox(fs) => fs.read_dir(path),
WasiFsRoot::Backing(fs) => fs.read_dir(path), WasiFsRoot::Backing(fs) => fs.read_dir(path),
} }
} }
fn create_dir(&self, path: &Path) -> wasmer_vfs::Result<()> { fn create_dir(&self, path: &Path) -> virtual_fs::Result<()> {
match self { match self {
WasiFsRoot::Sandbox(fs) => fs.create_dir(path), WasiFsRoot::Sandbox(fs) => fs.create_dir(path),
WasiFsRoot::Backing(fs) => fs.create_dir(path), WasiFsRoot::Backing(fs) => fs.create_dir(path),
} }
} }
fn remove_dir(&self, path: &Path) -> wasmer_vfs::Result<()> { fn remove_dir(&self, path: &Path) -> virtual_fs::Result<()> {
match self { match self {
WasiFsRoot::Sandbox(fs) => fs.remove_dir(path), WasiFsRoot::Sandbox(fs) => fs.remove_dir(path),
WasiFsRoot::Backing(fs) => fs.remove_dir(path), WasiFsRoot::Backing(fs) => fs.remove_dir(path),
} }
} }
fn rename(&self, from: &Path, to: &Path) -> wasmer_vfs::Result<()> { fn rename(&self, from: &Path, to: &Path) -> virtual_fs::Result<()> {
match self { match self {
WasiFsRoot::Sandbox(fs) => fs.rename(from, to), WasiFsRoot::Sandbox(fs) => fs.rename(from, to),
WasiFsRoot::Backing(fs) => fs.rename(from, to), WasiFsRoot::Backing(fs) => fs.rename(from, to),
} }
} }
fn metadata(&self, path: &Path) -> wasmer_vfs::Result<wasmer_vfs::Metadata> { fn metadata(&self, path: &Path) -> virtual_fs::Result<virtual_fs::Metadata> {
match self { match self {
WasiFsRoot::Sandbox(fs) => fs.metadata(path), WasiFsRoot::Sandbox(fs) => fs.metadata(path),
WasiFsRoot::Backing(fs) => fs.metadata(path), WasiFsRoot::Backing(fs) => fs.metadata(path),
} }
} }
fn symlink_metadata(&self, path: &Path) -> wasmer_vfs::Result<wasmer_vfs::Metadata> { fn symlink_metadata(&self, path: &Path) -> virtual_fs::Result<virtual_fs::Metadata> {
match self { match self {
WasiFsRoot::Sandbox(fs) => fs.symlink_metadata(path), WasiFsRoot::Sandbox(fs) => fs.symlink_metadata(path),
WasiFsRoot::Backing(fs) => fs.symlink_metadata(path), WasiFsRoot::Backing(fs) => fs.symlink_metadata(path),
} }
} }
fn remove_file(&self, path: &Path) -> wasmer_vfs::Result<()> { fn remove_file(&self, path: &Path) -> virtual_fs::Result<()> {
match self { match self {
WasiFsRoot::Sandbox(fs) => fs.remove_file(path), WasiFsRoot::Sandbox(fs) => fs.remove_file(path),
WasiFsRoot::Backing(fs) => fs.remove_file(path), WasiFsRoot::Backing(fs) => fs.remove_file(path),
@@ -1771,12 +1771,12 @@ impl std::fmt::Debug for WasiFs {
} }
/// Returns the default filesystem backing /// Returns the default filesystem backing
pub fn default_fs_backing() -> Box<dyn wasmer_vfs::FileSystem + Send + Sync> { pub fn default_fs_backing() -> Box<dyn virtual_fs::FileSystem + Send + Sync> {
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(feature = "host-fs")] { if #[cfg(feature = "host-fs")] {
Box::new(wasmer_vfs::host_fs::FileSystem::default()) Box::new(virtual_fs::host_fs::FileSystem::default())
} else if #[cfg(not(feature = "host-fs"))] { } else if #[cfg(not(feature = "host-fs"))] {
Box::new(wasmer_vfs::mem_fs::FileSystem::default()) Box::new(virtual_fs::mem_fs::FileSystem::default())
} else { } else {
Box::new(FallbackFileSystem::default()) Box::new(FallbackFileSystem::default())
} }
@@ -1793,7 +1793,7 @@ impl FallbackFileSystem {
} }
impl FileSystem for FallbackFileSystem { impl FileSystem for FallbackFileSystem {
fn read_dir(&self, _path: &Path) -> Result<wasmer_vfs::ReadDir, FsError> { fn read_dir(&self, _path: &Path) -> Result<virtual_fs::ReadDir, FsError> {
Self::fail(); Self::fail();
} }
fn create_dir(&self, _path: &Path) -> Result<(), FsError> { fn create_dir(&self, _path: &Path) -> Result<(), FsError> {
@@ -1805,21 +1805,21 @@ impl FileSystem for FallbackFileSystem {
fn rename(&self, _from: &Path, _to: &Path) -> Result<(), FsError> { fn rename(&self, _from: &Path, _to: &Path) -> Result<(), FsError> {
Self::fail(); Self::fail();
} }
fn metadata(&self, _path: &Path) -> Result<wasmer_vfs::Metadata, FsError> { fn metadata(&self, _path: &Path) -> Result<virtual_fs::Metadata, FsError> {
Self::fail(); Self::fail();
} }
fn symlink_metadata(&self, _path: &Path) -> Result<wasmer_vfs::Metadata, FsError> { fn symlink_metadata(&self, _path: &Path) -> Result<virtual_fs::Metadata, FsError> {
Self::fail(); Self::fail();
} }
fn remove_file(&self, _path: &Path) -> Result<(), FsError> { fn remove_file(&self, _path: &Path) -> Result<(), FsError> {
Self::fail(); Self::fail();
} }
fn new_open_options(&self) -> wasmer_vfs::OpenOptions { fn new_open_options(&self) -> virtual_fs::OpenOptions {
Self::fail(); Self::fail();
} }
} }
pub fn virtual_file_type_to_wasi_file_type(file_type: wasmer_vfs::FileType) -> Filetype { pub fn virtual_file_type_to_wasi_file_type(file_type: virtual_fs::FileType) -> Filetype {
// TODO: handle other file types // TODO: handle other file types
if file_type.is_dir() { if file_type.is_dir() {
Filetype::Directory Filetype::Directory

View File

@@ -65,27 +65,27 @@ use thiserror::Error;
use tracing::error; use tracing::error;
// re-exports needed for OS // re-exports needed for OS
pub use wasmer; pub use wasmer;
pub use wasmer_wasi_types; pub use wasmer_wasix_types;
use wasmer::{ use wasmer::{
imports, namespace, AsStoreMut, Exports, FunctionEnv, Imports, Memory32, MemoryAccessError, imports, namespace, AsStoreMut, Exports, FunctionEnv, Imports, Memory32, MemoryAccessError,
MemorySize, RuntimeError, MemorySize, RuntimeError,
}; };
pub use wasmer_vfs; pub use virtual_fs;
#[deprecated(since = "2.1.0", note = "Please use `wasmer_vfs::FsError`")] #[deprecated(since = "2.1.0", note = "Please use `virtual_fs::FsError`")]
pub use wasmer_vfs::FsError as WasiFsError; pub use virtual_fs::FsError as WasiFsError;
#[deprecated(since = "2.1.0", note = "Please use `wasmer_vfs::VirtualFile`")] #[deprecated(since = "2.1.0", note = "Please use `virtual_fs::VirtualFile`")]
pub use wasmer_vfs::VirtualFile as WasiFile; pub use virtual_fs::VirtualFile as WasiFile;
pub use wasmer_vfs::{DuplexPipe, FsError, Pipe, VirtualFile, WasiBidirectionalSharedPipePair}; pub use virtual_fs::{DuplexPipe, FsError, Pipe, VirtualFile, WasiBidirectionalSharedPipePair};
pub use wasmer_vnet; pub use virtual_net;
pub use wasmer_vnet::{UnsupportedVirtualNetworking, VirtualNetworking}; pub use virtual_net::{UnsupportedVirtualNetworking, VirtualNetworking};
#[cfg(feature = "host-vnet")] #[cfg(feature = "host-vnet")]
pub use wasmer_wasi_local_networking::{ pub use virtual_net::host::{
io_err_into_net_error, LocalNetworking, LocalTcpListener, LocalTcpStream, LocalUdpSocket, io_err_into_net_error, LocalNetworking, LocalTcpListener, LocalTcpStream, LocalUdpSocket,
}; };
use wasmer_wasi_types::wasi::{BusErrno, Errno, ExitCode}; use wasmer_wasix_types::wasi::{BusErrno, Errno, ExitCode};
pub use crate::{ pub use crate::{
fs::{default_fs_backing, Fd, WasiFs, WasiInodes, VIRTUAL_ROOT_FD}, fs::{default_fs_backing, Fd, WasiFs, WasiInodes, VIRTUAL_ROOT_FD},

View File

@@ -4,10 +4,10 @@ use std::{
time::Duration, time::Duration,
}; };
use virtual_net::{IpCidr, IpRoute, NetworkError};
use wasmer::{MemoryView, WasmPtr}; use wasmer::{MemoryView, WasmPtr};
use wasmer_types::MemorySize; use wasmer_types::MemorySize;
use wasmer_vnet::{IpCidr, IpRoute, NetworkError}; use wasmer_wasix_types::{
use wasmer_wasi_types::{
types::{ types::{
OptionTag, OptionTimestamp, Route, __wasi_addr_ip4_t, __wasi_addr_ip6_t, OptionTag, OptionTimestamp, Route, __wasi_addr_ip4_t, __wasi_addr_ip6_t,
__wasi_addr_port_t, __wasi_addr_port_u, __wasi_addr_t, __wasi_addr_u, __wasi_cidr_t, __wasi_addr_port_t, __wasi_addr_port_u, __wasi_addr_t, __wasi_addr_u, __wasi_cidr_t,

View File

@@ -10,12 +10,12 @@ use std::{
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use wasmer_types::MemorySize; use virtual_net::{
use wasmer_vnet::{
VirtualIcmpSocket, VirtualNetworking, VirtualRawSocket, VirtualTcpListener, VirtualTcpSocket, VirtualIcmpSocket, VirtualNetworking, VirtualRawSocket, VirtualTcpListener, VirtualTcpSocket,
VirtualUdpSocket, VirtualUdpSocket,
}; };
use wasmer_wasi_types::wasi::{ use wasmer_types::MemorySize;
use wasmer_wasix_types::wasi::{
Addressfamily, Errno, Fdflags, Rights, SockProto, Sockoption, Socktype, Addressfamily, Errno, Fdflags, Rights, SockProto, Sockoption, Socktype,
}; };
@@ -1213,7 +1213,7 @@ impl InodeSocketProtected {
pub fn poll_read_ready( pub fn poll_read_ready(
&mut self, &mut self,
cx: &mut std::task::Context<'_>, cx: &mut std::task::Context<'_>,
) -> std::task::Poll<wasmer_vnet::Result<usize>> { ) -> std::task::Poll<virtual_net::Result<usize>> {
match &mut self.kind { match &mut self.kind {
InodeSocketKind::TcpListener { socket, .. } => socket.poll_accept_ready(cx), InodeSocketKind::TcpListener { socket, .. } => socket.poll_accept_ready(cx),
InodeSocketKind::TcpStream { socket, .. } => socket.poll_read_ready(cx), InodeSocketKind::TcpStream { socket, .. } => socket.poll_read_ready(cx),
@@ -1221,7 +1221,7 @@ impl InodeSocketProtected {
InodeSocketKind::Raw(socket) => socket.poll_read_ready(cx), InodeSocketKind::Raw(socket) => socket.poll_read_ready(cx),
InodeSocketKind::Icmp(socket) => socket.poll_read_ready(cx), InodeSocketKind::Icmp(socket) => socket.poll_read_ready(cx),
InodeSocketKind::PreSocket { .. } => { InodeSocketKind::PreSocket { .. } => {
std::task::Poll::Ready(Err(wasmer_vnet::NetworkError::IOError)) std::task::Poll::Ready(Err(virtual_net::NetworkError::IOError))
} }
} }
} }
@@ -1229,7 +1229,7 @@ impl InodeSocketProtected {
pub fn poll_write_ready( pub fn poll_write_ready(
&mut self, &mut self,
cx: &mut std::task::Context<'_>, cx: &mut std::task::Context<'_>,
) -> std::task::Poll<wasmer_vnet::Result<usize>> { ) -> std::task::Poll<virtual_net::Result<usize>> {
match &mut self.kind { match &mut self.kind {
InodeSocketKind::TcpListener { .. } => std::task::Poll::Pending, InodeSocketKind::TcpListener { .. } => std::task::Poll::Pending,
InodeSocketKind::TcpStream { socket, .. } => socket.poll_write_ready(cx), InodeSocketKind::TcpStream { socket, .. } => socket.poll_write_ready(cx),
@@ -1237,7 +1237,7 @@ impl InodeSocketProtected {
InodeSocketKind::Raw(socket) => socket.poll_write_ready(cx), InodeSocketKind::Raw(socket) => socket.poll_write_ready(cx),
InodeSocketKind::Icmp(socket) => socket.poll_write_ready(cx), InodeSocketKind::Icmp(socket) => socket.poll_write_ready(cx),
InodeSocketKind::PreSocket { .. } => { InodeSocketKind::PreSocket { .. } => {
std::task::Poll::Ready(Err(wasmer_vnet::NetworkError::IOError)) std::task::Poll::Ready(Err(virtual_net::NetworkError::IOError))
} }
} }
} }

View File

@@ -5,7 +5,7 @@ use crate::{
VirtualBusError, VirtualBusError,
}; };
use wasmer::{FunctionEnvMut, Store}; use wasmer::{FunctionEnvMut, Store};
use wasmer_wasi_types::wasi::Errno; use wasmer_wasix_types::wasi::Errno;
use crate::{ use crate::{
bin_factory::{spawn_exec, BinaryPackage, ModuleCache}, bin_factory::{spawn_exec, BinaryPackage, ModuleCache},

View File

@@ -3,7 +3,7 @@ pub mod builtins;
use std::{collections::HashMap, sync::Arc}; use std::{collections::HashMap, sync::Arc};
use wasmer::{FunctionEnvMut, Store}; use wasmer::{FunctionEnvMut, Store};
use wasmer_wasi_types::wasi::Errno; use wasmer_wasix_types::wasi::Errno;
use crate::{ use crate::{
bin_factory::ModuleCache, syscalls::stderr_write, VirtualBusError, WasiEnv, WasiRuntime, bin_factory::ModuleCache, syscalls::stderr_write, VirtualBusError, WasiEnv, WasiRuntime,

View File

@@ -16,13 +16,13 @@ use linked_hash_set::LinkedHashSet;
use tokio::sync::{mpsc, RwLock}; use tokio::sync::{mpsc, RwLock};
#[allow(unused_imports, dead_code)] #[allow(unused_imports, dead_code)]
use tracing::{debug, error, info, trace, warn}; use tracing::{debug, error, info, trace, warn};
#[cfg(feature = "sys")] use virtual_fs::{
use wasmer::Engine;
use wasmer_vfs::{
ArcBoxFile, ArcFile, AsyncWriteExt, CombineFile, DeviceFile, DuplexPipe, FileSystem, Pipe, ArcBoxFile, ArcFile, AsyncWriteExt, CombineFile, DeviceFile, DuplexPipe, FileSystem, Pipe,
PipeRx, PipeTx, RootFileSystemBuilder, VirtualFile, PipeRx, PipeTx, RootFileSystemBuilder, VirtualFile,
}; };
use wasmer_wasi_types::{types::__WASI_STDIN_FILENO, wasi::BusErrno}; #[cfg(feature = "sys")]
use wasmer::Engine;
use wasmer_wasix_types::{types::__WASI_STDIN_FILENO, wasi::BusErrno};
use super::{cconst::ConsoleConst, common::*, task::TaskJoinHandle}; use super::{cconst::ConsoleConst, common::*, task::TaskJoinHandle};
use crate::{ use crate::{
@@ -209,7 +209,7 @@ impl Console {
} else { } else {
let mut stderr = self.stderr.clone(); let mut stderr = self.stderr.clone();
tasks.block_on(async { tasks.block_on(async {
wasmer_vfs::AsyncWriteExt::write_all( virtual_fs::AsyncWriteExt::write_all(
&mut stderr, &mut stderr,
format!("package not found [{}]\r\n", webc).as_bytes(), format!("package not found [{}]\r\n", webc).as_bytes(),
) )
@@ -229,7 +229,7 @@ impl Console {
if let Err(err) = env.uses(self.uses.clone()) { if let Err(err) = env.uses(self.uses.clone()) {
let mut stderr = self.stderr.clone(); let mut stderr = self.stderr.clone();
tasks.block_on(async { tasks.block_on(async {
wasmer_vfs::AsyncWriteExt::write_all( virtual_fs::AsyncWriteExt::write_all(
&mut stderr, &mut stderr,
format!("{}\r\n", err).as_bytes(), format!("{}\r\n", err).as_bytes(),
) )
@@ -268,7 +268,7 @@ impl Console {
data.insert_str(0, ConsoleConst::TERM_NO_WRAPAROUND); data.insert_str(0, ConsoleConst::TERM_NO_WRAPAROUND);
let mut stderr = self.stderr.clone(); let mut stderr = self.stderr.clone();
wasmer_vfs::AsyncWriteExt::write_all(&mut stderr, data.as_str().as_bytes()) virtual_fs::AsyncWriteExt::write_all(&mut stderr, data.as_str().as_bytes())
.await .await
.ok(); .ok();
} }

View File

@@ -10,7 +10,7 @@ use std::{
use crate::WasiRuntimeError; use crate::WasiRuntimeError;
use tracing::trace; use tracing::trace;
use wasmer_wasi_types::{ use wasmer_wasix_types::{
types::Signal, types::Signal,
wasi::{Errno, ExitCode, Snapshot0Clockid, TlKey, TlUser, TlVal}, wasi::{Errno, ExitCode, Snapshot0Clockid, TlKey, TlUser, TlVal},
}; };

View File

@@ -1,6 +1,6 @@
use std::time::Duration; use std::time::Duration;
use wasmer_wasi_types::types::Signal; use wasmer_wasix_types::types::Signal;
#[derive(thiserror::Error, Debug)] #[derive(thiserror::Error, Debug)]
#[error("Signal could not be delivered")] #[error("Signal could not be delivered")]

View File

@@ -4,7 +4,7 @@ use std::{
task::{Context, Poll}, task::{Context, Poll},
}; };
use wasmer_wasi_types::wasi::{Errno, ExitCode}; use wasmer_wasix_types::wasi::{Errno, ExitCode};
use crate::WasiRuntimeError; use crate::WasiRuntimeError;

View File

@@ -6,7 +6,7 @@ use std::{
}; };
use bytes::{Bytes, BytesMut}; use bytes::{Bytes, BytesMut};
use wasmer_wasi_types::{ use wasmer_wasix_types::{
types::Signal, types::Signal,
wasi::{Errno, ExitCode}, wasi::{Errno, ExitCode},
}; };

View File

@@ -5,8 +5,8 @@ use std::{
use derivative::*; use derivative::*;
use futures::future::BoxFuture; use futures::future::BoxFuture;
use wasmer_vfs::{AsyncWriteExt, NullFile, VirtualFile}; use virtual_fs::{AsyncWriteExt, NullFile, VirtualFile};
use wasmer_wasi_types::wasi::{Signal, Snapshot0Clockid}; use wasmer_wasix_types::wasi::{Signal, Snapshot0Clockid};
use crate::syscalls::platform_clock_time_get; use crate::syscalls::platform_clock_time_get;

View File

@@ -3,9 +3,9 @@ use crate::WasiTtyState;
/// [`TtyBridge`] implementation for Unix systems. /// [`TtyBridge`] implementation for Unix systems.
#[derive(Debug, Default, Clone)] #[derive(Debug, Default, Clone)]
pub struct SysTyy; pub struct SysTty;
impl TtyBridge for SysTyy { impl TtyBridge for SysTty {
fn reset(&self) { fn reset(&self) {
sys::reset().ok(); sys::reset().ok();
} }

View File

@@ -1,7 +1,7 @@
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf, sync::Arc};
use bytes::Bytes; use bytes::Bytes;
use wasmer_vfs::{webc_fs::WebcFileSystem, FileSystem}; use virtual_fs::{webc_fs::WebcFileSystem, FileSystem};
use webc::{ use webc::{
metadata::Manifest, metadata::Manifest,
v1::{ParseOptions, WebC, WebCMmap, WebCOwned}, v1::{ParseOptions, WebC, WebCMmap, WebCOwned},

View File

@@ -15,8 +15,8 @@ use tokio::{
io::{AsyncBufReadExt, AsyncRead, AsyncWrite, AsyncWriteExt}, io::{AsyncBufReadExt, AsyncRead, AsyncWrite, AsyncWriteExt},
runtime::Handle, runtime::Handle,
}; };
use virtual_fs::{FileSystem, PassthruFileSystem, RootFileSystemBuilder, TmpFileSystem};
use wasmer::Module; use wasmer::Module;
use wasmer_vfs::{FileSystem, PassthruFileSystem, RootFileSystemBuilder, TmpFileSystem};
use wcgi_host::CgiDialect; use wcgi_host::CgiDialect;
use crate::{ use crate::{

View File

@@ -2,8 +2,8 @@ use std::{collections::HashMap, convert::Infallible, net::SocketAddr, path::Path
use anyhow::{Context, Error}; use anyhow::{Context, Error};
use futures::future::AbortHandle; use futures::future::AbortHandle;
use virtual_fs::FileSystem;
use wasmer::{Engine, Module, Store}; use wasmer::{Engine, Module, Store};
use wasmer_vfs::FileSystem;
use wcgi_host::CgiDialect; use wcgi_host::CgiDialect;
use webc::metadata::{ use webc::metadata::{
annotations::{Wasi, Wcgi}, annotations::{Wasi, Wcgi},

View File

@@ -1,14 +1,16 @@
pub mod task_manager; pub mod task_manager;
use crate::{http::DynHttpClient, os::TtyBridge, WasiTtyState};
pub use self::task_manager::{SpawnType, SpawnedMemory, VirtualTaskManager}; pub use self::task_manager::{SpawnType, SpawnedMemory, VirtualTaskManager};
use crate::{http::DynHttpClient, os::TtyBridge, WasiTtyState};
use derivative::Derivative;
use std::{ use std::{
fmt, fmt,
sync::{Arc, Mutex}, sync::{Arc, Mutex},
}; };
use wasmer_vnet::{DynVirtualNetworking, VirtualNetworking};
use derivative::Derivative;
use virtual_net::{DynVirtualNetworking, VirtualNetworking};
#[cfg(feature = "sys")] #[cfg(feature = "sys")]
pub type ArcTunables = std::sync::Arc<dyn wasmer::Tunables + Send + Sync>; pub type ArcTunables = std::sync::Arc<dyn wasmer::Tunables + Send + Sync>;
@@ -116,9 +118,9 @@ impl PluggableRuntimeImplementation {
// TODO: the cfg flags below should instead be handled by separate implementations. // TODO: the cfg flags below should instead be handled by separate implementations.
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(feature = "host-vnet")] { if #[cfg(feature = "host-vnet")] {
let networking = Arc::new(wasmer_wasi_local_networking::LocalNetworking::default()); let networking = Arc::new(virtual_net::host::LocalNetworking::default());
} else { } else {
let networking = Arc::new(wasmer_vnet::UnsupportedVirtualNetworking::default()); let networking = Arc::new(virtual_net::UnsupportedVirtualNetworking::default());
} }
} }
cfg_if::cfg_if! { cfg_if::cfg_if! {

View File

@@ -8,9 +8,9 @@ use std::{
use rand::Rng; use rand::Rng;
use thiserror::Error; use thiserror::Error;
use virtual_fs::{ArcFile, FsError, TmpFileSystem, VirtualFile};
use wasmer::{AsStoreMut, Instance, Module}; use wasmer::{AsStoreMut, Instance, Module};
use wasmer_vfs::{ArcFile, FsError, TmpFileSystem, VirtualFile}; use wasmer_wasix_types::wasi::Errno;
use wasmer_wasi_types::wasi::Errno;
use crate::{ use crate::{
bin_factory::{BinFactory, ModuleCache}, bin_factory::{BinFactory, ModuleCache},
@@ -29,7 +29,7 @@ use super::env::WasiEnvInit;
/// ///
/// Usage: /// Usage:
/// ```no_run /// ```no_run
/// # use wasmer_wasi::{WasiEnv, WasiStateCreationError}; /// # use wasmer_wasix::{WasiEnv, WasiStateCreationError};
/// # fn main() -> Result<(), WasiStateCreationError> { /// # fn main() -> Result<(), WasiStateCreationError> {
/// let mut state_builder = WasiEnv::builder("wasi-prog-name"); /// let mut state_builder = WasiEnv::builder("wasi-prog-name");
/// state_builder /// state_builder
@@ -368,7 +368,7 @@ impl WasiEnvBuilder {
/// Usage: /// Usage:
/// ///
/// ```no_run /// ```no_run
/// # use wasmer_wasi::{WasiEnv, WasiStateCreationError}; /// # use wasmer_wasix::{WasiEnv, WasiStateCreationError};
/// # fn main() -> Result<(), WasiStateCreationError> { /// # fn main() -> Result<(), WasiStateCreationError> {
/// WasiEnv::builder("program_name") /// WasiEnv::builder("program_name")
/// .preopen_build(|p| p.directory("src").read(true).write(true).create(true))? /// .preopen_build(|p| p.directory("src").read(true).write(true).create(true))?
@@ -390,7 +390,7 @@ impl WasiEnvBuilder {
/// Usage: /// Usage:
/// ///
/// ```no_run /// ```no_run
/// # use wasmer_wasi::{WasiEnv, WasiStateCreationError}; /// # use wasmer_wasix::{WasiEnv, WasiStateCreationError};
/// # fn main() -> Result<(), WasiStateCreationError> { /// # fn main() -> Result<(), WasiStateCreationError> {
/// WasiEnv::builder("program_name") /// WasiEnv::builder("program_name")
/// .preopen_build(|p| p.directory("src").read(true).write(true).create(true))? /// .preopen_build(|p| p.directory("src").read(true).write(true).create(true))?
@@ -508,19 +508,19 @@ impl WasiEnvBuilder {
/// Sets the FileSystem to be used with this WASI instance. /// Sets the FileSystem to be used with this WASI instance.
/// ///
/// This is usually used in case a custom `wasmer_vfs::FileSystem` is needed. /// This is usually used in case a custom `virtual_fs::FileSystem` is needed.
pub fn fs(mut self, fs: Box<dyn wasmer_vfs::FileSystem + Send + Sync>) -> Self { pub fn fs(mut self, fs: Box<dyn virtual_fs::FileSystem + Send + Sync>) -> Self {
self.set_fs(fs); self.set_fs(fs);
self self
} }
pub fn set_fs(&mut self, fs: Box<dyn wasmer_vfs::FileSystem + Send + Sync>) { pub fn set_fs(&mut self, fs: Box<dyn virtual_fs::FileSystem + Send + Sync>) {
self.fs = Some(WasiFsRoot::Backing(Arc::new(fs))); self.fs = Some(WasiFsRoot::Backing(Arc::new(fs)));
} }
/// Sets a new sandbox FileSystem to be used with this WASI instance. /// Sets a new sandbox FileSystem to be used with this WASI instance.
/// ///
/// This is usually used in case a custom `wasmer_vfs::FileSystem` is needed. /// This is usually used in case a custom `virtual_fs::FileSystem` is needed.
pub fn sandbox_fs(mut self, fs: TmpFileSystem) -> Self { pub fn sandbox_fs(mut self, fs: TmpFileSystem) -> Self {
self.fs = Some(WasiFsRoot::Sandbox(Arc::new(fs))); self.fs = Some(WasiFsRoot::Sandbox(Arc::new(fs)));
self self

View File

@@ -3,15 +3,15 @@ use std::{collections::HashMap, ops::Deref, path::PathBuf, sync::Arc, time::Dura
use derivative::Derivative; use derivative::Derivative;
use rand::Rng; use rand::Rng;
use tracing::{trace, warn}; use tracing::{trace, warn};
use virtual_fs::{FsError, VirtualFile};
use virtual_net::DynVirtualNetworking;
#[cfg(feature = "sys")] #[cfg(feature = "sys")]
use wasmer::NativeEngineExt; use wasmer::NativeEngineExt;
use wasmer::{ use wasmer::{
AsStoreMut, AsStoreRef, FunctionEnvMut, Global, Instance, Memory, MemoryView, Module, AsStoreMut, AsStoreRef, FunctionEnvMut, Global, Instance, Memory, MemoryView, Module,
TypedFunction, TypedFunction,
}; };
use wasmer_vfs::{FsError, VirtualFile}; use wasmer_wasix_types::{
use wasmer_vnet::DynVirtualNetworking;
use wasmer_wasi_types::{
types::Signal, types::Signal,
wasi::{Errno, ExitCode, Snapshot0Clockid}, wasi::{Errno, ExitCode, Snapshot0Clockid},
}; };
@@ -771,7 +771,7 @@ impl WasiEnv {
use std::{borrow::Cow, collections::VecDeque}; use std::{borrow::Cow, collections::VecDeque};
#[allow(unused_imports)] #[allow(unused_imports)]
use wasmer_vfs::FileSystem; use virtual_fs::FileSystem;
let mut already: HashMap<String, Cow<'static, str>> = HashMap::new(); let mut already: HashMap<String, Cow<'static, str>> = HashMap::new();
@@ -864,7 +864,7 @@ impl WasiEnv {
use std::path::Path; use std::path::Path;
#[allow(unused_imports)] #[allow(unused_imports)]
use wasmer_vfs::FileSystem; use virtual_fs::FileSystem;
#[cfg(feature = "sys")] #[cfg(feature = "sys")]
for (command, target) in map_commands.iter() { for (command, target) in map_commands.iter() {

View File

@@ -1,6 +1,6 @@
use tracing::trace; use tracing::trace;
use wasmer::{AsStoreMut, AsStoreRef, ExportError, FunctionEnv, Imports, Instance, Memory, Module}; use wasmer::{AsStoreMut, AsStoreRef, ExportError, FunctionEnv, Imports, Instance, Memory, Module};
use wasmer_wasi_types::wasi::ExitCode; use wasmer_wasix_types::wasi::ExitCode;
use crate::{ use crate::{
state::WasiInstanceHandles, state::WasiInstanceHandles,

View File

@@ -32,9 +32,9 @@ use std::{
use derivative::Derivative; use derivative::Derivative;
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use virtual_fs::{FileOpener, FileSystem, FsError, OpenOptions, VirtualFile};
use wasmer::Store; use wasmer::Store;
use wasmer_vfs::{FileOpener, FileSystem, FsError, OpenOptions, VirtualFile}; use wasmer_wasix_types::wasi::{Errno, Fd as WasiFd, Rights, Snapshot0Clockid};
use wasmer_wasi_types::wasi::{Errno, Fd as WasiFd, Rights, Snapshot0Clockid};
pub use self::{ pub use self::{
builder::*, builder::*,
@@ -61,8 +61,8 @@ impl FileOpener for WasiStateOpener {
fn open( fn open(
&self, &self,
path: &Path, path: &Path,
conf: &wasmer_vfs::OpenOptionsConfig, conf: &virtual_fs::OpenOptionsConfig,
) -> wasmer_vfs::Result<Box<dyn VirtualFile + Send + Sync + 'static>> { ) -> virtual_fs::Result<Box<dyn VirtualFile + Send + Sync + 'static>> {
let mut new_options = self.root_fs.new_open_options(); let mut new_options = self.root_fs.new_open_options();
new_options.options(conf.clone()); new_options.options(conf.clone());
new_options.open(path) new_options.open(path)
@@ -180,7 +180,7 @@ impl WasiState {
pub(crate) fn fs_read_dir<P: AsRef<Path>>( pub(crate) fn fs_read_dir<P: AsRef<Path>>(
&self, &self,
path: P, path: P,
) -> Result<wasmer_vfs::ReadDir, Errno> { ) -> Result<virtual_fs::ReadDir, Errno> {
self.fs self.fs
.root_fs .root_fs
.read_dir(path.as_ref()) .read_dir(path.as_ref())

View File

@@ -5,15 +5,15 @@ use cfg_if::cfg_if;
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use wasmer_wasi_types::wasi::{BusErrno, Rights}; use wasmer_wasix_types::wasi::{BusErrno, Rights};
use crate::VirtualBusError; use crate::VirtualBusError;
cfg_if! { cfg_if! {
if #[cfg(feature = "host-fs")] { if #[cfg(feature = "host-fs")] {
pub use wasmer_vfs::host_fs::{Stderr, Stdin, Stdout}; pub use virtual_fs::host_fs::{Stderr, Stdin, Stdout};
} else { } else {
pub use wasmer_vfs::mem_fs::{Stderr, Stdin, Stdout}; pub use virtual_fs::mem_fs::{Stderr, Stdin, Stdout};
} }
} }

View File

@@ -1,6 +1,6 @@
use tracing::{field, instrument, trace_span}; use tracing::{field, instrument, trace_span};
use wasmer::{AsStoreMut, FunctionEnvMut, WasmPtr}; use wasmer::{AsStoreMut, FunctionEnvMut, WasmPtr};
use wasmer_wasi_types::wasi::{ use wasmer_wasix_types::wasi::{
Errno, Event, EventFdReadwrite, Eventrwflags, Eventtype, Fd, Filesize, Filestat, Filetype, Errno, Event, EventFdReadwrite, Eventrwflags, Eventtype, Fd, Filesize, Filestat, Filetype,
Snapshot0Event, Snapshot0Filestat, Snapshot0Subscription, Snapshot0Whence, Subscription, Snapshot0Event, Snapshot0Filestat, Snapshot0Subscription, Snapshot0Whence, Subscription,
Whence, Whence,

View File

@@ -1,7 +1,7 @@
#![allow(unused, clippy::too_many_arguments, clippy::cognitive_complexity)] #![allow(unused, clippy::too_many_arguments, clippy::cognitive_complexity)]
pub mod types { pub mod types {
pub use wasmer_wasi_types::{types::*, wasi}; pub use wasmer_wasix_types::{types::*, wasi};
} }
#[cfg(any( #[cfg(any(
@@ -63,16 +63,16 @@ pub use unix::*;
#[cfg(any(target_family = "wasm"))] #[cfg(any(target_family = "wasm"))]
pub use wasm::*; pub use wasm::*;
pub(crate) use virtual_fs::{
AsyncSeekExt, AsyncWriteExt, DuplexPipe, FileSystem, FsError, VirtualFile,
};
pub(crate) use virtual_net::StreamSecurity;
pub(crate) use wasmer::{ pub(crate) use wasmer::{
AsStoreMut, AsStoreRef, Extern, Function, FunctionEnv, FunctionEnvMut, Global, Instance, AsStoreMut, AsStoreRef, Extern, Function, FunctionEnv, FunctionEnvMut, Global, Instance,
Memory, Memory32, Memory64, MemoryAccessError, MemoryError, MemorySize, MemoryView, Module, Memory, Memory32, Memory64, MemoryAccessError, MemoryError, MemorySize, MemoryView, Module,
OnCalledAction, Pages, RuntimeError, Store, TypedFunction, Value, WasmPtr, WasmSlice, OnCalledAction, Pages, RuntimeError, Store, TypedFunction, Value, WasmPtr, WasmSlice,
}; };
pub(crate) use wasmer_vfs::{ pub(crate) use wasmer_wasix_types::{asyncify::__wasi_asyncify_t, wasi::EventUnion};
AsyncSeekExt, AsyncWriteExt, DuplexPipe, FileSystem, FsError, VirtualFile,
};
pub(crate) use wasmer_vnet::StreamSecurity;
pub(crate) use wasmer_wasi_types::{asyncify::__wasi_asyncify_t, wasi::EventUnion};
#[cfg(any(target_os = "windows"))] #[cfg(any(target_os = "windows"))]
pub use windows::*; pub use windows::*;

View File

@@ -5,7 +5,7 @@ use libc::{
CLOCK_REALTIME, CLOCK_THREAD_CPUTIME_ID, CLOCK_REALTIME, CLOCK_THREAD_CPUTIME_ID,
}; };
use wasmer::WasmRef; use wasmer::WasmRef;
use wasmer_wasi_types::wasi::{Errno, Snapshot0Clockid, Timestamp}; use wasmer_wasix_types::wasi::{Errno, Snapshot0Clockid, Timestamp};
use crate::syscalls::types::*; use crate::syscalls::types::*;

View File

@@ -1,6 +1,6 @@
use std::{collections::VecDeque, task::Waker}; use std::{collections::VecDeque, task::Waker};
use wasmer_vfs::{AsyncReadExt, ReadBuf}; use virtual_fs::{AsyncReadExt, ReadBuf};
use super::*; use super::*;
use crate::{fs::NotificationInner, syscalls::*}; use crate::{fs::NotificationInner, syscalls::*};
@@ -280,7 +280,7 @@ fn fd_read_internal<M: MemorySize>(
.map_err(mem_error_to_wasi)?; .map_err(mem_error_to_wasi)?;
total_read += total_read +=
wasmer_vfs::AsyncReadExt::read(&mut pipe, buf.as_mut()).await?; virtual_fs::AsyncReadExt::read(&mut pipe, buf.as_mut()).await?;
} }
Ok(total_read) Ok(total_read)
} }

View File

@@ -109,7 +109,7 @@ pub fn path_open<M: MemorySize>(
(false, false, false) (false, false, false)
}; };
wasmer_vfs::OpenOptionsConfig { virtual_fs::OpenOptionsConfig {
read: fs_rights_base.contains(Rights::FD_READ), read: fs_rights_base.contains(Rights::FD_READ),
write: write_permission, write: write_permission,
create_new: create_permission && o_flags.contains(Oflags::EXCL), create_new: create_permission && o_flags.contains(Oflags::EXCL),
@@ -118,7 +118,7 @@ pub fn path_open<M: MemorySize>(
truncate: truncate_permission, truncate: truncate_permission,
} }
} }
Err(_) => wasmer_vfs::OpenOptionsConfig { Err(_) => virtual_fs::OpenOptionsConfig {
append: fs_flags.contains(Fdflags::APPEND), append: fs_flags.contains(Fdflags::APPEND),
write: fs_rights_base.contains(Rights::FD_WRITE), write: fs_rights_base.contains(Rights::FD_WRITE),
read: fs_rights_base.contains(Rights::FD_READ), read: fs_rights_base.contains(Rights::FD_READ),
@@ -128,7 +128,7 @@ pub fn path_open<M: MemorySize>(
}, },
}; };
let parent_rights = wasmer_vfs::OpenOptionsConfig { let parent_rights = virtual_fs::OpenOptionsConfig {
read: working_dir.rights.contains(Rights::FD_READ), read: working_dir.rights.contains(Rights::FD_READ),
write: working_dir.rights.contains(Rights::FD_WRITE), write: working_dir.rights.contains(Rights::FD_WRITE),
// The parent is a directory, which is why these options // The parent is a directory, which is why these options

View File

@@ -1,6 +1,6 @@
use std::f32::consts::E; use std::f32::consts::E;
use wasmer_wasi_types::wasi::SubscriptionClock; use wasmer_wasix_types::wasi::SubscriptionClock;
use super::*; use super::*;
use crate::{ use crate::{

View File

@@ -1,4 +1,4 @@
use wasmer_vfs::Pipe; use virtual_fs::Pipe;
use super::*; use super::*;
use crate::syscalls::*; use crate::syscalls::*;

View File

@@ -1,4 +1,4 @@
use wasmer_wasi_types::wasi::{JoinFlags, JoinStatus, JoinStatusType, JoinStatusUnion, OptionPid}; use wasmer_wasix_types::wasi::{JoinFlags, JoinStatus, JoinStatusType, JoinStatusUnion, OptionPid};
use super::*; use super::*;
use crate::syscalls::*; use crate::syscalls::*;

View File

@@ -1,4 +1,4 @@
use wasmer_vfs::Pipe; use virtual_fs::Pipe;
use super::*; use super::*;
use crate::syscalls::*; use crate::syscalls::*;

View File

@@ -1,4 +1,4 @@
use wasmer_vfs::AsyncReadExt; use virtual_fs::AsyncReadExt;
use super::*; use super::*;
use crate::{syscalls::*, WasiInodes}; use crate::{syscalls::*, WasiInodes};
@@ -130,7 +130,7 @@ pub fn sock_send_file<M: MemorySize>(
// TODO: optimize with MaybeUninit // TODO: optimize with MaybeUninit
let mut buf = vec![0u8; sub_count as usize]; let mut buf = vec![0u8; sub_count as usize];
let amt = let amt =
wasmer_vfs::AsyncReadExt::read(pipe, &mut buf[..]) virtual_fs::AsyncReadExt::read(pipe, &mut buf[..])
.await .await
.map_err(map_io_err)?; .map_err(map_io_err)?;
buf.truncate(amt); buf.truncate(amt);

View File

@@ -2,7 +2,7 @@ use super::*;
use crate::syscalls::*; use crate::syscalls::*;
use wasmer::vm::VMMemory; use wasmer::vm::VMMemory;
use wasmer_wasi_types::wasi::ThreadStart; use wasmer_wasix_types::wasi::ThreadStart;
/// ### `thread_spawn()` /// ### `thread_spawn()`
/// Creates a new thread by spawning that shares the same /// Creates a new thread by spawning that shares the same

View File

@@ -8,7 +8,7 @@ pub use self::dummy_waker::WasiDummyWaker;
use std::collections::BTreeSet; use std::collections::BTreeSet;
use wasmer::Module; use wasmer::Module;
use wasmer_wasi_types::wasi::Errno; use wasmer_wasix_types::wasi::Errno;
pub use self::thread_parker::WasiParkingLot; pub use self::thread_parker::WasiParkingLot;
pub(crate) use owned_mutex_guard::{ pub(crate) use owned_mutex_guard::{

View File

@@ -4,7 +4,7 @@ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},
sync::Arc, sync::Arc,
}; };
use wasmer_vfs::FileSystem; use virtual_fs::FileSystem;
use tracing::*; use tracing::*;
#[allow(unused_imports)] #[allow(unused_imports)]
@@ -364,7 +364,7 @@ where
} }
// Add the file system from the webc // Add the file system from the webc
let webc_fs = wasmer_vfs::webc_fs::WebcFileSystem::init_all(ownership.clone()); let webc_fs = virtual_fs::webc_fs::WebcFileSystem::init_all(ownership.clone());
let top_level_dirs = webc_fs.top_level_dirs().clone(); let top_level_dirs = webc_fs.top_level_dirs().clone();
pck.webc_fs = Some(Arc::new(webc_fs)); pck.webc_fs = Some(Arc::new(webc_fs));
pck.webc_top_level_dirs = top_level_dirs; pck.webc_top_level_dirs = top_level_dirs;

View File

@@ -4,13 +4,13 @@ use std::{path::Path, time::Duration};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use reqwest::Client; use reqwest::Client;
use wasmer_wasi::runners::{Runner, WapmContainer}; use wasmer_wasix::runners::{Runner, WapmContainer};
#[cfg(feature = "webc_runner_rt_wasi")] #[cfg(feature = "webc_runner_rt_wasi")]
mod wasi { mod wasi {
use tokio::runtime::Handle; use tokio::runtime::Handle;
use wasmer::Store; use wasmer::Store;
use wasmer_wasi::{ use wasmer_wasix::{
runners::wasi::WasiRunner, runtime::task_manager::tokio::TokioTaskManager, WasiError, runners::wasi::WasiRunner, runtime::task_manager::tokio::TokioTaskManager, WasiError,
}; };
@@ -88,7 +88,7 @@ mod wcgi {
use futures::{channel::mpsc::Sender, future::AbortHandle, SinkExt, StreamExt}; use futures::{channel::mpsc::Sender, future::AbortHandle, SinkExt, StreamExt};
use rand::Rng; use rand::Rng;
use tokio::runtime::Handle; use tokio::runtime::Handle;
use wasmer_wasi::{runners::wcgi::WcgiRunner, runtime::task_manager::tokio::TokioTaskManager}; use wasmer_wasix::{runners::wcgi::WcgiRunner, runtime::task_manager::tokio::TokioTaskManager};
use super::*; use super::*;
@@ -162,7 +162,7 @@ mod wcgi {
handle: Handle, handle: Handle,
} }
impl wasmer_wasi::runners::wcgi::Callbacks for Callbacks { impl wasmer_wasix::runners::wcgi::Callbacks for Callbacks {
fn started(&self, abort: futures::stream::AbortHandle) { fn started(&self, abort: futures::stream::AbortHandle) {
let mut sender = self.sender.clone(); let mut sender = self.sender.clone();
self.handle.spawn(async move { self.handle.spawn(async move {

View File

@@ -1,8 +1,8 @@
use std::sync::Arc; use std::sync::Arc;
use virtual_fs::{AsyncReadExt, AsyncWriteExt};
use wasmer::{Module, Store}; use wasmer::{Module, Store};
use wasmer_vfs::{AsyncReadExt, AsyncWriteExt}; use wasmer_wasix::{Pipe, PluggableRuntimeImplementation, WasiEnv};
use wasmer_wasi::{Pipe, PluggableRuntimeImplementation, WasiEnv};
mod sys { mod sys {
#[tokio::test] #[tokio::test]

View File

@@ -13,8 +13,8 @@ edition = "2018"
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
wasmer = { path = "../../../lib/api", version = "=3.2.0-alpha.1", default-features = false } wasmer = { path = "../../../lib/api", version = "=3.2.0-alpha.1", default-features = false }
wasmer-wasi = { path = "../../../lib/wasi", version = "=3.2.0-alpha.1" } wasmer-wasix = { path = "../../../lib/wasi", version = "0.1.0" }
wasmer-vfs = { path = "../../../lib/vfs", version = "=3.2.0-alpha.1" } virtual-fs = { path = "../../../lib/vfs", version = "0.1.0" }
wast = "38.0" wast = "38.0"
serde = "1" serde = "1"
tempfile = "3.4.0" tempfile = "3.4.0"

View File

@@ -5,13 +5,13 @@ use std::path::{Path, PathBuf};
use std::pin::Pin; use std::pin::Pin;
use std::sync::{mpsc, Arc, Mutex}; use std::sync::{mpsc, Arc, Mutex};
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use wasmer::{FunctionEnv, Imports, Module, Store}; use virtual_fs::{
use wasmer_vfs::{
host_fs, mem_fs, passthru_fs, tmp_fs, union_fs, AsyncRead, AsyncSeek, AsyncWrite, host_fs, mem_fs, passthru_fs, tmp_fs, union_fs, AsyncRead, AsyncSeek, AsyncWrite,
AsyncWriteExt, FileSystem, Pipe, ReadBuf, RootFileSystemBuilder, AsyncWriteExt, FileSystem, Pipe, ReadBuf, RootFileSystemBuilder,
}; };
use wasmer_wasi::types::wasi::{Filesize, Timestamp}; use wasmer::{FunctionEnv, Imports, Module, Store};
use wasmer_wasi::{ use wasmer_wasix::types::wasi::{Filesize, Timestamp};
use wasmer_wasix::{
generate_import_object_from_env, get_wasi_version, FsError, PluggableRuntimeImplementation, generate_import_object_from_env, get_wasi_version, FsError, PluggableRuntimeImplementation,
VirtualFile, WasiEnv, WasiEnvBuilder, WasiRuntime, WasiVersion, VirtualFile, WasiEnv, WasiEnvBuilder, WasiRuntime, WasiVersion,
}; };
@@ -20,22 +20,22 @@ use wast::parser::{self, Parse, ParseBuffer, Parser};
/// The kind of filesystem `WasiTest` is going to use. /// The kind of filesystem `WasiTest` is going to use.
#[derive(Debug)] #[derive(Debug)]
pub enum WasiFileSystemKind { pub enum WasiFileSystemKind {
/// Instruct the test runner to use `wasmer_vfs::host_fs`. /// Instruct the test runner to use `virtual_fs::host_fs`.
Host, Host,
/// Instruct the test runner to use `wasmer_vfs::mem_fs`. /// Instruct the test runner to use `virtual_fs::mem_fs`.
InMemory, InMemory,
/// Instruct the test runner to use `wasmer_vfs::tmp_fs` /// Instruct the test runner to use `virtual_fs::tmp_fs`
Tmp, Tmp,
/// Instruct the test runner to use `wasmer_vfs::passtru_fs` /// Instruct the test runner to use `virtual_fs::passtru_fs`
PassthruMemory, PassthruMemory,
/// Instruct the test runner to use `wasmer_vfs::union_fs<host_fs, mem_fs>` /// Instruct the test runner to use `virtual_fs::union_fs<host_fs, mem_fs>`
UnionHostMemory, UnionHostMemory,
/// Instruct the test runner to use the TempFs returned by `wasmer_vfs::builder::RootFileSystemBuilder` /// Instruct the test runner to use the TempFs returned by `virtual_fs::builder::RootFileSystemBuilder`
RootFileSystemBuilder, RootFileSystemBuilder,
} }
@@ -690,7 +690,7 @@ impl AsyncRead for OutputCapturerer {
} }
} }
/// When using `wasmer_vfs::mem_fs`, we cannot rely on `BASE_TEST_DIR` /// When using `virtual_fs::mem_fs`, we cannot rely on `BASE_TEST_DIR`
/// because the host filesystem cannot be used. Instead, we are /// because the host filesystem cannot be used. Instead, we are
/// copying `BASE_TEST_DIR` to the `mem_fs`. /// copying `BASE_TEST_DIR` to the `mem_fs`.
fn map_host_fs_to_mem_fs<'a>( fn map_host_fs_to_mem_fs<'a>(