Use new WasiCtxBuilder types from wasi-common (#490)

* use new `WasiCtxBuilder` types from wasi-common

* Update wasi-common deps
This commit is contained in:
Adam C. Foltzer
2019-11-07 03:25:43 -08:00
committed by Jakub Konka
parent 9e373d1b6b
commit ab3cd945bc
4 changed files with 6 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ wasmtime-obj = { path = "wasmtime-obj" }
wasmtime-wast = { path = "wasmtime-wast" }
wasmtime-wasi = { path = "wasmtime-wasi" }
wasmtime-wasi-c = { path = "wasmtime-wasi-c", optional = true }
wasi-common = { git = "https://github.com/CraneStation/wasi-common", rev = "37ce4ba"}
wasi-common = { git = "https://github.com/CraneStation/wasi-common", rev = "2fe3530"}
docopt = "1.0.1"
serde = { "version" = "1.0.94", features = ["derive"] }
faerie = "0.12.0"

View File

@@ -35,7 +35,7 @@ core = ["hashbrown/nightly", "cranelift-codegen/core", "cranelift-wasm/core", "w
[dev-dependencies]
# for wasmtime.rs
wasi-common = { git = "https://github.com/CraneStation/wasi-common", rev = "37ce4ba"}
wasi-common = { git = "https://github.com/CraneStation/wasi-common", rev = "2fe3530"}
docopt = "1.0.1"
serde = { "version" = "1.0.94", features = ["derive"] }
pretty_env_logger = "0.3.0"

View File

@@ -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"] }

View File

@@ -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(