From 9e6301be704f1af662c66052867bc48390dac8a4 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 6 Jan 2023 16:33:32 +0000 Subject: [PATCH] Reland: build: drop clap from dev-dependencies Some crates don't need it at all. Some crates are using it for a simple functionality which can be replaced easily. Signed-off-by: Wei Liu This was causing issues with the release build process but we now have a fix to clean residual build assets. Signed-off-by: Rob Bradford --- Cargo.toml | 3 --- build.rs | 5 +---- performance-metrics/Cargo.toml | 3 --- performance-metrics/build.rs | 6 ++---- vhost_user_block/Cargo.toml | 2 -- vhost_user_net/Cargo.toml | 2 -- 6 files changed, 3 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 89f8880ce..499891c6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,9 +43,6 @@ vmm = { path = "vmm" } vmm-sys-util = "0.11.0" vm-memory = "0.10.0" -[build-dependencies] -clap = { version = "4.0.29", features = ["cargo"] } - # List of patched crates [patch.crates-io] kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.6.0-tdx" } diff --git a/build.rs b/build.rs index 3c0c84df8..a0b98f571 100644 --- a/build.rs +++ b/build.rs @@ -3,13 +3,10 @@ // SPDX-License-Identifier: Apache-2.0 // -#[macro_use(crate_version)] -extern crate clap; - use std::process::Command; fn main() { - let mut version = "v".to_owned() + crate_version!(); + let mut version = "v".to_owned() + env!("CARGO_PKG_VERSION"); if let Ok(git_out) = Command::new("git").args(["describe", "--dirty"]).output() { if git_out.status.success() { diff --git a/performance-metrics/Cargo.toml b/performance-metrics/Cargo.toml index 85241e684..ab53bd4f3 100644 --- a/performance-metrics/Cargo.toml +++ b/performance-metrics/Cargo.toml @@ -13,6 +13,3 @@ serde_json = "1.0.89" test_infra = { path = "../test_infra" } thiserror = "1.0.38" wait-timeout = "0.2.0" - -[build-dependencies] -clap = { version = "4.0.29", features = ["cargo"] } diff --git a/performance-metrics/build.rs b/performance-metrics/build.rs index 0898cac38..7dcd810af 100644 --- a/performance-metrics/build.rs +++ b/performance-metrics/build.rs @@ -3,13 +3,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#[macro_use(crate_version)] -extern crate clap; - use std::process::Command; fn main() { - let mut git_human_readable = "v".to_owned() + crate_version!(); + let mut git_human_readable = "v".to_owned() + env!("CARGO_PKG_VERSION"); + if let Ok(git_out) = Command::new("git").args(["describe", "--dirty"]).output() { if git_out.status.success() { if let Ok(git_out_str) = String::from_utf8(git_out.stdout) { diff --git a/vhost_user_block/Cargo.toml b/vhost_user_block/Cargo.toml index ff12ef76a..0d1ab834a 100644 --- a/vhost_user_block/Cargo.toml +++ b/vhost_user_block/Cargo.toml @@ -20,5 +20,3 @@ virtio-queue = "0.7.0" vm-memory = "0.10.0" vmm-sys-util = "0.11.0" -[build-dependencies] -clap = { version = "4.0.29", features = ["cargo"] } diff --git a/vhost_user_net/Cargo.toml b/vhost_user_net/Cargo.toml index e29f55e25..da06dd84f 100644 --- a/vhost_user_net/Cargo.toml +++ b/vhost_user_net/Cargo.toml @@ -18,5 +18,3 @@ virtio-bindings = "0.1.0" vm-memory = "0.10.0" vmm-sys-util = "0.11.0" -[build-dependencies] -clap = { version = "4.0.29", features = ["cargo"] }