Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 5258f49

Browse files
authored
Merge pull request #159 from bytecodealliance/pch/move_host_to_common
Move all library code from `host` into `wasi-common`
2 parents fa823d1 + 0bc2e81 commit 5258f49

29 files changed

+419
-294
lines changed

Cargo.lock

Lines changed: 77 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ rustix = "0.37.9"
2525
async-trait = "0.1.59"
2626
io-lifetimes = { version = "1.0.0", default-features = false }
2727
wasi-common = { path = "wasi-common" }
28+
wasi-cap-std-sync = { path = "wasi-common/cap-std-sync" }
2829
once_cell = "1.12.0"
2930
system-interface = { version = "0.25.1", features = ["cap_std_impls"] }
3031
wit-bindgen = { version = "0.4.0", default-features = false }
3132
ipnet = "2" # TODO: Move to cap_std::ipnet instead, when that's released.
33+
wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "299131ae2d6655c49138bfab2c4469650763ef3b", features = ["component-model"] }
3234

3335
[dependencies]
3436
wasi = { version = "0.11.0", default-features = false }

host/Cargo.toml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@ edition.workspace = true
55

66
[dependencies]
77
anyhow = { workspace = true }
8-
thiserror = { workspace = true }
9-
async-trait = { workspace = true }
108
cap-std = { workspace = true }
11-
cap-rand = { workspace = true }
12-
cap-net-ext = { workspace = true }
13-
tokio = { version = "1.22.0", features = [ "rt", "macros" ] }
14-
tracing = { workspace = true }
15-
wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "299131ae2d6655c49138bfab2c4469650763ef3b", features = ["component-model"] }
16-
wasi-common = { path = "../wasi-common" }
17-
wasi-cap-std-sync = { path = "../wasi-common/cap-std-sync" }
9+
wasmtime = { workspace = true }
10+
wasi-common = { workspace = true }
11+
wasi-cap-std-sync = { workspace = true }
1812
clap = { version = "4.1.9", features = ["derive"] }
1913
tracing-subscriber = { version = "0.3", default-features = false, features = ["env-filter", "fmt" ]}
14+
tokio = { version = "1", features = ["full"] }
2015

2116
[dev-dependencies]
17+
tracing = { workspace = true }
18+
cap-rand = { workspace = true }
2219
test-programs-macros = { path = "../test-programs/macros" }
2320
test-log = { version = "0.2", default-features = false, features = ["trace"] }
2421
tempfile = "3.3.0"

host/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::{Context, Result};
2-
use host::{wasi, WasiCtx};
32
use wasi_cap_std_sync::WasiCtxBuilder;
3+
use wasi_common::{wasi, WasiCtx};
44
use wasmtime::{
55
component::{Component, Linker},
66
Config, Engine, Store,

host/src/udp.rs

Lines changed: 0 additions & 132 deletions
This file was deleted.

host/tests/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use anyhow::Result;
22
use cap_rand::RngCore;
33
use cap_std::{ambient_authority, fs::Dir, time::Duration};
4-
use host::{wasi::command::add_to_linker, wasi::command::Command, WasiCtx};
54
use std::{
65
io::{Cursor, Write},
76
sync::Mutex,
@@ -12,6 +11,7 @@ use wasi_common::{
1211
dir::ReadOnlyDir,
1312
pipe::ReadPipe,
1413
};
14+
use wasi_common::{wasi::command::add_to_linker, wasi::command::Command, WasiCtx};
1515
use wasmtime::{
1616
component::{Component, Linker},
1717
Config, Engine, Store,

0 commit comments

Comments
 (0)