Skip to content

Commit

Permalink
chore: mark non-bench targets as not containing benchmarks
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
roypat authored and pb8o committed Jun 8, 2023
1 parent 85b3e99 commit b8d2909
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
libc = "0.2.117"
serde = { version = "1.0.136", features = ["derive"] }
Expand Down
4 changes: 4 additions & 0 deletions src/cpu-template-helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ build = "../../build.rs"
license = "Apache-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[bin]]
name = "cpu-template-helper"
bench = false

[dependencies]
clap = { version = "4.3.0", features = ["derive", "string"] }
libc = "0.2.117"
Expand Down
3 changes: 3 additions & 0 deletions src/dumbo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
bitflags = "1.3.2"
derive_more = { version = "0.99.17", default-features = false, features = ["from"] }
Expand Down
4 changes: 4 additions & 0 deletions src/firecracker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ description = "Firecracker enables you to deploy workloads in lightweight virtua
homepage = "https://firecracker-microvm.github.io/"
license = "Apache-2.0"

[[bin]]
name = "firecracker"
bench = false

[dependencies]
event-manager = "0.3.0"
libc = "0.2.117"
Expand Down
4 changes: 4 additions & 0 deletions src/jailer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ description = "Process for starting Firecracker in production scenarios; applies
homepage = "https://firecracker-microvm.github.io/"
license = "Apache-2.0"

[[bin]]
name = "jailer"
bench = false

[dependencies]
libc = "0.2.117"
nix = { version = "0.26.2", default-features = false, features = ["dir"] }
Expand Down
3 changes: 3 additions & 0 deletions src/logger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
lazy_static = "1.4.0"
libc = "0.2.117"
Expand Down
3 changes: 3 additions & 0 deletions src/mmds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
aes-gcm = { version = "0.10.1", default-features = false, features = ["aes"] }
base64 = "0.13.0"
Expand Down
3 changes: 3 additions & 0 deletions src/net_gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false
3 changes: 3 additions & 0 deletions src/rate_limiter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
timerfd = "1.2.0"
versionize = "0.1.10"
Expand Down
4 changes: 4 additions & 0 deletions src/rebase-snap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ edition = "2021"
build = "../../build.rs"
license = "Apache-2.0"

[[bin]]
name = "rebase-snap"
bench = false

[dependencies]
libc = "0.2.117"

Expand Down
4 changes: 4 additions & 0 deletions src/seccompiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ description = "Program that compiles multi-threaded seccomp-bpf filters expresse
homepage = "https://firecracker-microvm.github.io/"
license = "Apache-2.0"

[lib]
bench = false

[[bin]]
name = "seccompiler-bin"
path = "src/seccompiler_bin.rs"
bench = false

[dependencies]
bincode = "1.2.1"
Expand Down
3 changes: 3 additions & 0 deletions src/snapshot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
autobenches = false
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
libc = "0.2.117"
versionize = "0.1.10"
Expand Down
3 changes: 3 additions & 0 deletions src/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
derive_more = { version = "0.99.17", default-features = false, features = ["from"] }
libc = "0.2.117"
Expand Down
3 changes: 3 additions & 0 deletions src/virtio_gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ authors = ["The Chromium OS Authors"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
3 changes: 3 additions & 0 deletions src/vmm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = ["Amazon Firecracker team <[email protected]>"]
edition = "2021"
license = "Apache-2.0"

[lib]
bench = false

[dependencies]
aws-lc-rs = "1.0.2"
bitflags = "2.0.2"
Expand Down

0 comments on commit b8d2909

Please sign in to comment.