From b113b052e5bcb83484789ad1e5b1a2ec9fe91d9c Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 16 Sep 2022 18:16:26 +0000 Subject: [PATCH] kata-os-common: reduce internal dependencies kata-os-common is an "aggregate crate" used many places where only a subset of the code is used (esp applicatiions written in Rust). Reduce internal dependencies to reduce bloat and speed up builds: - expand the scope of the "camkes_support" feature - adjust sel4-sys deps that do not require serde support - add a "capdl_support" feature (default disabled) Change-Id: Ie1319f1168d37bd6c8f0de8d19708153c7b80dcd GitOrigin-RevId: a02c4b1a5d6ca26920cba013d9339415b607a2c0 --- apps/system/components/kata-os-common/Cargo.toml | 15 ++++++++------- .../kata-os-common/src/capdl/Cargo.toml | 2 +- apps/system/components/kata-os-common/src/lib.rs | 3 +++ .../kata-os-common/src/model/Cargo.toml | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/system/components/kata-os-common/Cargo.toml b/apps/system/components/kata-os-common/Cargo.toml index 790cddc..5a855c6 100644 --- a/apps/system/components/kata-os-common/Cargo.toml +++ b/apps/system/components/kata-os-common/Cargo.toml @@ -19,17 +19,18 @@ edition = "2021" [features] default = ["camkes_support"] -camkes_support = [] +camkes_support = ["camkes", "copyregion", "cspace-slot", "slot-allocator"] +capdl_support = ["capdl", "model"] [dependencies] allocator = { path = "src/allocator" } -camkes = { path = "src/camkes" } -capdl = { path = "src/capdl" } -copyregion = { path = "src/copyregion" } -cspace-slot = { path = "src/cspace-slot" } +camkes = { path = "src/camkes", optional = true } +capdl = { path = "src/capdl", optional = true } +copyregion = { path = "src/copyregion", optional = true } +cspace-slot = { path = "src/cspace-slot", optional = true } logger = { path = "src/logger" } -model = { path = "src/model" } +model = { path = "src/model", optional = true } panic = { path = "src/panic" } scheduling = { path = "src/scheduling" } sel4-sys = { path = "src/sel4-sys" } -slot-allocator = { path = "src/slot-allocator" } +slot-allocator = { path = "src/slot-allocator", optional = true } diff --git a/apps/system/components/kata-os-common/src/capdl/Cargo.toml b/apps/system/components/kata-os-common/src/capdl/Cargo.toml index b0353f3..a7bf653 100644 --- a/apps/system/components/kata-os-common/src/capdl/Cargo.toml +++ b/apps/system/components/kata-os-common/src/capdl/Cargo.toml @@ -20,5 +20,5 @@ path = "mod.rs" [dependencies] cstr_core = { version = "0.2.3", default-features = false } -sel4-sys = { path = "../sel4-sys" } +sel4-sys = { path = "../sel4-sys", default-features = false } log = { version = "0.4", features = ["release_max_level_info"] } diff --git a/apps/system/components/kata-os-common/src/lib.rs b/apps/system/components/kata-os-common/src/lib.rs index 3bd21ba..ad2ccc2 100644 --- a/apps/system/components/kata-os-common/src/lib.rs +++ b/apps/system/components/kata-os-common/src/lib.rs @@ -17,14 +17,17 @@ pub extern crate allocator; #[cfg(feature = "camkes_support")] pub extern crate camkes; +#[cfg(feature = "capdl_support")] pub extern crate capdl; #[cfg(feature = "camkes_support")] pub extern crate copyregion; #[cfg(feature = "camkes_support")] pub extern crate cspace_slot; pub extern crate logger; +#[cfg(feature = "capdl_support")] pub extern crate model; pub extern crate panic; pub extern crate scheduling; pub extern crate sel4_sys; +#[cfg(feature = "camkes_support")] pub extern crate slot_allocator; diff --git a/apps/system/components/kata-os-common/src/model/Cargo.toml b/apps/system/components/kata-os-common/src/model/Cargo.toml index 8411b79..3ed7fe0 100644 --- a/apps/system/components/kata-os-common/src/model/Cargo.toml +++ b/apps/system/components/kata-os-common/src/model/Cargo.toml @@ -45,6 +45,6 @@ capdl = { path = "../capdl" } cpio = { git = "https://github.com/rcore-os/cpio" } cstr_core = "0.2.3" log = { version = "0.4", features = ["release_max_level_info"] } -sel4-sys = { path = "../sel4-sys", features = ["arch_generic"] } +sel4-sys = { path = "../sel4-sys", default-features = false, features = ["arch_generic"] } smallvec = "1.2" static_assertions = "1.1"