Skip to content

Commit b8d2909

Browse files
roypatpb8o
authored andcommitted
chore: mark non-bench targets as not containing benchmarks
Cargo will otherwise look in cfg(test) modules for benchmarks, and compile them for libtest, no criterion. This causes errors should we ever want to pass command-line options to criterion (as libtest obviously does not understand them). It also increases compile time (and thus test runtime), since we needlessly compile all unittests. Signed-off-by: Patrick Roy <[email protected]>
1 parent 85b3e99 commit b8d2909

File tree

15 files changed

+50
-0
lines changed

15 files changed

+50
-0
lines changed

src/api_server/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
55
edition = "2021"
66
license = "Apache-2.0"
77

8+
[lib]
9+
bench = false
10+
811
[dependencies]
912
libc = "0.2.117"
1013
serde = { version = "1.0.136", features = ["derive"] }

src/cpu-template-helper/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ build = "../../build.rs"
77
license = "Apache-2.0"
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

10+
[[bin]]
11+
name = "cpu-template-helper"
12+
bench = false
13+
1014
[dependencies]
1115
clap = { version = "4.3.0", features = ["derive", "string"] }
1216
libc = "0.2.117"

src/dumbo/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
55
edition = "2021"
66
license = "Apache-2.0"
77

8+
[lib]
9+
bench = false
10+
811
[dependencies]
912
bitflags = "1.3.2"
1013
derive_more = { version = "0.99.17", default-features = false, features = ["from"] }

src/firecracker/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ description = "Firecracker enables you to deploy workloads in lightweight virtua
88
homepage = "https://firecracker-microvm.github.io/"
99
license = "Apache-2.0"
1010

11+
[[bin]]
12+
name = "firecracker"
13+
bench = false
14+
1115
[dependencies]
1216
event-manager = "0.3.0"
1317
libc = "0.2.117"

src/jailer/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ description = "Process for starting Firecracker in production scenarios; applies
88
homepage = "https://firecracker-microvm.github.io/"
99
license = "Apache-2.0"
1010

11+
[[bin]]
12+
name = "jailer"
13+
bench = false
14+
1115
[dependencies]
1216
libc = "0.2.117"
1317
nix = { version = "0.26.2", default-features = false, features = ["dir"] }

src/logger/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
55
edition = "2021"
66
license = "Apache-2.0"
77

8+
[lib]
9+
bench = false
10+
811
[dependencies]
912
lazy_static = "1.4.0"
1013
libc = "0.2.117"

src/mmds/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
55
edition = "2021"
66
license = "Apache-2.0"
77

8+
[lib]
9+
bench = false
10+
811
[dependencies]
912
aes-gcm = { version = "0.10.1", default-features = false, features = ["aes"] }
1013
base64 = "0.13.0"

src/net_gen/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ version = "0.1.0"
44
authors = ["The Chromium OS Authors"]
55
edition = "2021"
66
license = "Apache-2.0"
7+
8+
[lib]
9+
bench = false

src/rate_limiter/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
55
edition = "2021"
66
license = "Apache-2.0"
77

8+
[lib]
9+
bench = false
10+
811
[dependencies]
912
timerfd = "1.2.0"
1013
versionize = "0.1.10"

src/rebase-snap/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ edition = "2021"
66
build = "../../build.rs"
77
license = "Apache-2.0"
88

9+
[[bin]]
10+
name = "rebase-snap"
11+
bench = false
12+
913
[dependencies]
1014
libc = "0.2.117"
1115

0 commit comments

Comments
 (0)