runtime-rs: Put local dependencies into workspace

Put local dependencies into workspace to avoid complex path dependencies all
over the workspace. This gives an overview of local dependencies this workspace
uses, where those crates are located, and simplifies the local dependencies
referencing process.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He 2025-04-09 07:30:29 +00:00
parent 3769ad9c0d
commit 28c09ae645
15 changed files with 109 additions and 80 deletions

View File

@ -11,3 +11,32 @@ members = [
"tests/utils",
]
[workspace.dependencies]
agent = { path = "crates/agent" }
hypervisor = { path = "crates/hypervisor" }
persist = { path = "crates/persist"}
resource = { path = "crates/resource" }
runtimes = { path = "crates/runtimes" }
service = { path = "crates/service" }
tests_utils = { path = "tests/utils" }
ch-config = { path = "crates/hypervisor/ch-config" }
common = { path = "crates/runtimes/common" }
linux_container = { path = "crates/runtimes/linux_container" }
virt_container = { path = "crates/runtimes/virt_container" }
wasm_container = { path = "crates/runtimes/wasm_container" }
# Local dependencies from `src/libs`
kata-sys-util = { path = "../libs/kata-sys-util"}
kata-types = { path = "../libs/kata-types"}
logging = { path = "../libs/logging"}
protocols = { path = "../libs/protocols", features=["async"] }
runtime-spec = { path = "../libs/runtime-spec" }
safe-path = { path = "../libs/safe-path"}
shim-interface = { path = "../libs/shim-interface" }
test-utils = { path = "../libs/test-utils" }
# Local dependencies from `src/dragonball`
dragonball = { path = "../dragonball" }
dbs-utils = { path = "../dragonball/dbs_utils" }

View File

@ -25,9 +25,9 @@ nix = "0.24.2"
oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies
kata-types = { path = "../../../libs/kata-types"}
logging = { path = "../../../libs/logging"}
protocols = { path = "../../../libs/protocols", features=["async"] }
kata-types = { workspace = true }
logging = { workspace = true }
protocols = { workspace = true, features=["async"] }
[features]
default = []

View File

@ -41,17 +41,17 @@ hyperlocal = "0.8.0"
hyper = { version = "0.14.18", features = ["client"] }
# Local dependencies
kata-sys-util = { path = "../../../libs/kata-sys-util" }
kata-types = { path = "../../../libs/kata-types" }
logging = { path = "../../../libs/logging" }
protocols = { path = "../../../libs/protocols", features = ["async"] }
shim-interface = { path = "../../../libs/shim-interface" }
persist = { path = "../persist" }
ch-config = { path = "ch-config", optional = true }
tests_utils = { path = "../../tests/utils" }
kata-sys-util = { workspace = true }
kata-types = { workspace = true }
logging = { workspace = true }
protocols = { workspace = true, features = ["async"] }
shim-interface = { workspace = true }
persist = { workspace = true }
ch-config = { workspace = true, optional = true }
tests_utils = { workspace = true }
# Local dependencies: Dragonball
dragonball = { path = "../../../dragonball", features = [
dragonball = { workspace = true, features = [
"atomic-guest-memory",
"virtio-vsock",
"hotplug",
@ -65,7 +65,7 @@ dragonball = { path = "../../../dragonball", features = [
"vhost-user-net",
"host-device",
], optional = true }
dbs-utils = { path = "../../../dragonball/dbs_utils" }
dbs-utils = { workspace = true }
[features]
default = []
@ -81,8 +81,8 @@ serial_test = "2.0.0"
# Local dev-dependencies
# Force the CH tests to run, even when the feature is not enabled for
# a normal build.
hypervisor = { path = ".", features = ["cloud-hypervisor"] }
test-utils = { path = "../../../libs/test-utils" }
hypervisor = { workspace = true, features = ["cloud-hypervisor"] }
test-utils = { workspace = true }
[build-dependencies]
ttrpc-codegen = "0.4.2"

View File

@ -24,5 +24,5 @@ thiserror = "1.0.38"
api_client = { git = "https://github.com/cloud-hypervisor/cloud-hypervisor", crate = "api_client", tag = "v27.0" }
# Local dependencies
kata-types = { path = "../../../../libs/kata-types"}
kata-sys-util = { path = "../../../../libs/kata-sys-util"}
kata-types = { workspace = true }
kata-sys-util = { workspace = true }

View File

@ -13,7 +13,7 @@ serde = { version = "1.0.138", features = ["derive"] }
serde_json = "1.0.82"
# Local dependencies
kata-sys-util = { path = "../../../libs/kata-sys-util"}
kata-types = { path = "../../../libs/kata-types" }
shim-interface = { path = "../../../libs/shim-interface" }
safe-path = { path = "../../../libs/safe-path"}
kata-sys-util = { workspace = true }
kata-types = { workspace = true }
shim-interface = { workspace = true }
safe-path = { workspace = true }

View File

@ -9,7 +9,7 @@ license = "Apache-2.0"
tempfile = "3.2.0"
# Local dev-dependencies
test-utils = { path = "../../../libs/test-utils" }
test-utils = { workspace = true }
[dependencies]
anyhow = "^1.0"
@ -38,12 +38,12 @@ uuid = { version = "0.4", features = ["v4"] }
oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies
agent = { path = "../agent" }
hypervisor = { path = "../hypervisor" }
kata-types = { path = "../../../libs/kata-types" }
kata-sys-util = { path = "../../../libs/kata-sys-util" }
logging = { path = "../../../libs/logging" }
persist = { path = "../persist"}
tests_utils = { path = "../../tests/utils" }
agent = { workspace = true }
hypervisor = { workspace = true }
kata-types = { workspace = true }
kata-sys-util = { workspace = true }
logging = { workspace = true }
persist = { workspace = true }
tests_utils = { workspace = true }
[features]

View File

@ -27,21 +27,21 @@ prometheus = { version = "0.13.0", features = ["process"] }
oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies
agent = { path = "../agent" }
common = { path = "./common" }
kata-types = { path = "../../../libs/kata-types" }
kata-sys-util = { path = "../../../libs/kata-sys-util" }
logging = { path = "../../../libs/logging"}
runtime-spec = { path = "../../../libs/runtime-spec" }
shim-interface = { path = "../../../libs/shim-interface" }
persist = { path = "../persist" }
hypervisor = { path = "../hypervisor" }
resource = { path = "../resource" }
agent = { workspace = true }
common = { workspace = true }
kata-types = { workspace = true }
kata-sys-util = { workspace = true }
logging = { workspace = true }
runtime-spec = { workspace = true }
shim-interface = { workspace = true }
persist = { workspace = true }
hypervisor = { workspace = true }
resource = { workspace = true }
# Local dependencies: runtime handler
linux_container = { path = "./linux_container", optional = true }
virt_container = { path = "./virt_container", optional = true }
wasm_container = { path = "./wasm_container", optional = true }
linux_container = { workspace = true, optional = true }
virt_container = { workspace = true, optional = true }
wasm_container = { workspace = true, optional = true }
[features]
default = ["virt"]

View File

@ -24,10 +24,10 @@ ttrpc = "0.8.4"
oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies
persist = { path = "../../persist" }
agent = { path = "../../agent" }
kata-sys-util = { path = "../../../../libs/kata-sys-util" }
kata-types = { path = "../../../../libs/kata-types" }
runtime-spec = { path = "../../../../libs/runtime-spec" }
resource = { path = "../../resource" }
protocols = { path = "../../../../libs/protocols"}
persist = { workspace = true }
agent = { workspace = true }
kata-sys-util = { workspace = true }
kata-types = { workspace = true }
runtime-spec = { workspace = true }
resource = { workspace = true }
protocols = { workspace = true }

View File

@ -10,6 +10,6 @@ async-trait = "0.1.48"
tokio = { version = "1.38.0" }
# Local dependencies
common = { path = "../common" }
kata-types = { path = "../../../../libs/kata-types" }
resource = { path = "../../resource" }
common = { workspace = true }
kata-types = { workspace = true }
resource = { workspace = true }

View File

@ -30,15 +30,15 @@ oci-spec = { version = "0.6.8", features = ["runtime"] }
strum = { version = "0.24.0", features = ["derive"] }
# Local dependencies
agent = { path = "../../agent" }
common = { path = "../common" }
hypervisor = { path = "../../hypervisor", features = ["cloud-hypervisor"] }
kata-sys-util = { path = "../../../../libs/kata-sys-util" }
kata-types = { path = "../../../../libs/kata-types" }
logging = { path = "../../../../libs/logging"}
runtime-spec = { path = "../../../../libs/runtime-spec" }
persist = { path = "../../persist"}
resource = { path = "../../resource" }
agent = { workspace = true }
common = { workspace = true }
hypervisor = { workspace = true, features = ["cloud-hypervisor"] }
kata-sys-util = { workspace = true }
kata-types = { workspace = true }
logging = { workspace = true }
runtime-spec = { workspace = true }
persist = { workspace = true }
resource = { workspace = true }
[features]
default = ["cloud-hypervisor"]

View File

@ -10,6 +10,6 @@ async-trait = "0.1.48"
tokio = { version = "1.38.0" }
# Local dependencies
common = { path = "../common" }
kata-types = { path = "../../../../libs/kata-types" }
resource = { path = "../../resource" }
common = { workspace = true }
kata-types = { workspace = true }
resource = { workspace = true }

View File

@ -17,8 +17,8 @@ containerd-shim-protos = { version = "0.6.0", features = ["async", "sandbox"] }
containerd-shim = { version = "0.6.0", features = ["async"] }
# Local dependencies
common = { path = "../runtimes/common" }
logging = { path = "../../../libs/logging" }
kata-types = { path = "../../../libs/kata-types" }
runtimes = { path = "../runtimes" }
persist = { path = "../persist" }
common = { workspace = true }
logging = { workspace = true }
kata-types = { workspace = true }
runtimes = { workspace = true }
persist = { workspace = true }

View File

@ -10,6 +10,6 @@ anyhow = "^1.0"
tokio = { version = "1.38.0", features = [ "rt", "rt-multi-thread" ] }
# Local dependencies
common = { path = "../runtimes/common" }
logging = { path = "../../../libs/logging"}
runtimes = { path = "../runtimes" }
common = { workspace = true }
logging = { workspace = true }
runtimes = { workspace = true }

View File

@ -34,12 +34,12 @@ tracing-opentelemetry = "0.18.0"
oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies
kata-types = { path = "../../../libs/kata-types"}
kata-sys-util = { path = "../../../libs/kata-sys-util"}
logging = { path = "../../../libs/logging"}
runtime-spec = { path = "../../../libs/runtime-spec" }
service = { path = "../service" }
runtimes = { path = "../runtimes" }
kata-types = { workspace = true }
kata-sys-util = { workspace = true }
logging = { workspace = true }
runtime-spec = { workspace = true }
service = { workspace = true }
runtimes = { workspace = true }
[dev-dependencies]
tempfile = "3.2.0"
@ -47,4 +47,4 @@ rand = "0.8.4"
serial_test = "0.5.1"
# Local dev-dependencies
tests_utils = { path = "../../tests/utils"}
tests_utils = { workspace = true }

View File

@ -12,4 +12,4 @@ anyhow = "^1.0"
rand = "0.8.4"
# Local dependencies
kata-types = { path = "../../../libs/kata-types" }
kata-types = { workspace = true }