Use new WasiCtxBuilder types from wasi-common (#490)
* use new `WasiCtxBuilder` types from wasi-common * Update wasi-common deps
This commit is contained in:
committed by
Jakub Konka
parent
9e373d1b6b
commit
ab3cd945bc
@@ -13,7 +13,7 @@ edition = "2018"
|
||||
wasmtime-runtime = { path = "../wasmtime-runtime" }
|
||||
wasmtime-environ = { path = "../wasmtime-environ" }
|
||||
wasmtime-jit = { path = "../wasmtime-jit" }
|
||||
wasi-common = { git = "https://github.com/CraneStation/wasi-common", rev = "37ce4ba"}
|
||||
wasi-common = { git = "https://github.com/CraneStation/wasi-common", rev = "2fe3530"}
|
||||
cranelift-codegen = { version = "0.49", features = ["enable-serde"] }
|
||||
cranelift-entity = { version = "0.49", features = ["enable-serde"] }
|
||||
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
|
||||
|
||||
@@ -102,12 +102,9 @@ pub fn instantiate_wasi(
|
||||
let signatures = PrimaryMap::new();
|
||||
|
||||
let mut wasi_ctx_builder = WasiCtxBuilder::new()
|
||||
.and_then(|ctx| ctx.inherit_stdio())
|
||||
.and_then(|ctx| ctx.args(argv.iter()))
|
||||
.and_then(|ctx| ctx.envs(environ.iter()))
|
||||
.map_err(|err| {
|
||||
InstantiationError::Resource(format!("couldn't assemble WASI context object: {}", err))
|
||||
})?;
|
||||
.inherit_stdio()
|
||||
.args(argv)
|
||||
.envs(environ);
|
||||
|
||||
for (dir, f) in preopened_dirs {
|
||||
wasi_ctx_builder = wasi_ctx_builder.preopened_dir(
|
||||
|
||||
Reference in New Issue
Block a user