Skip to content

Commit 21ababf

Browse files
committed
crate/youki: Set the default features
Signed-off-by: utam0k <[email protected]>
1 parent 95e4f6e commit 21ababf

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

crates/youki/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ edition = "2021"
1111
build = "build.rs"
1212
keywords = ["youki", "container"]
1313

14+
# Don't forget to update info command.
1415
[features]
16+
default = ["systemd", "v2", "v1", "seccomp"]
1517
systemd = ["libcgroups/systemd", "libcontainer/systemd", "v2"]
1618
v2 = ["libcgroups/v2", "libcontainer/v2"]
1719
v1 = ["libcgroups/v1", "libcontainer/v1"]

crates/youki/src/commands/info.rs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,27 @@ pub fn info(_: Info) -> Result<()> {
2828

2929
/// print Version of Youki
3030
pub fn print_youki() {
31-
println!("{:<18}{}", "Version", env!("CARGO_PKG_VERSION"));
32-
println!("{:<18}{}", "Commit", env!("VERGEN_GIT_SHA"));
31+
println!("{:<16}", "Build");
32+
println!(" {:<16}{}", "Version", env!("CARGO_PKG_VERSION"));
33+
println!(" {:<16}{}", "Commit", env!("VERGEN_GIT_SHA"));
34+
let mut enabled_features: Vec<&str> = Vec::new();
35+
#[cfg(feature = "systemd")]
36+
enabled_features.push("systemd");
37+
#[cfg(feature = "v1")]
38+
enabled_features.push("v1");
39+
#[cfg(feature = "v2")]
40+
enabled_features.push("v2");
41+
#[cfg(feature = "cgroupsv2_devices")]
42+
enabled_features.push("cgroupsv2_devices");
43+
#[cfg(feature = "seccomp")]
44+
enabled_features.push("seccomp");
45+
#[cfg(feature = "wasm-wasmer")]
46+
enabled_features.push("wasm-wasmer");
47+
#[cfg(feature = "wasm-wasmedge")]
48+
enabled_features.push("wasm-wasmedge");
49+
#[cfg(feature = "wasm-wasmtime")]
50+
enabled_features.push("wasm-wasmtime");
51+
println!(" {:<16}{}", "Features", enabled_features.join(", "));
3352
}
3453

3554
/// Print Kernel Release, Version and Architecture

0 commit comments

Comments
 (0)