Skip to content

Commit

Permalink
Disable auto-benchmark harness for crates
Browse files Browse the repository at this point in the history
This disables automatic detection of `#[bench]` and other benchmarks
within the crates. Our benchmarks should all live in `benches`

This fixes a problem with criterion flags and should also reduce the
build requirements for `cargo bench` a bit

Taken from nushell#7952

See: https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
  • Loading branch information
sholderbach committed Feb 12, 2023
1 parent b0775b3 commit 1d5e1f9
Show file tree
Hide file tree
Showing 23 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -143,6 +143,7 @@ debug = false
[[bin]]
name = "nu"
path = "src/main.rs"
bench = false

# To use a development version of a dependency please use a global override here
# changing versions in each sub-crate of the workspace is tedious
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-cli/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-cli"
version = "0.75.1"

[lib]
bench = false

[dev-dependencies]
nu-test-support = { path = "../nu-test-support", version = "0.75.1" }
nu-command = { path = "../nu-command", version = "0.75.1" }
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-color-config/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-color-config"
version = "0.75.1"

[lib]
bench = false

[dependencies]
serde = { version="1.0.123", features=["derive"] }
# used only for text_style Alignments
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-command/Cargo.toml
Expand Up @@ -10,6 +10,9 @@ version = "0.75.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
bench = false

[dependencies]
nu-ansi-term = "0.46.0"
nu-color-config = { path = "../nu-color-config", version = "0.75.1" }
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-engine/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-engine"
version = "0.75.1"

[lib]
bench = false

[dependencies]
nu-protocol = { path = "../nu-protocol", features = ["plugin"], version = "0.75.1" }
nu-path = { path = "../nu-path", version = "0.75.1" }
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-explore/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-explore"
version = "0.75.1"

[lib]
bench = false

[dependencies]
nu-ansi-term = "0.46.0"
nu-protocol = { path = "../nu-protocol", version = "0.75.1" }
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-glob/Cargo.toml
Expand Up @@ -10,5 +10,8 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-glob"
edition = "2021"
categories = ["filesystem"]

[lib]
bench = false

[dev-dependencies]
doc-comment = "0.3"
3 changes: 3 additions & 0 deletions crates/nu-json/Cargo.toml
Expand Up @@ -9,6 +9,9 @@ version = "0.75.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
bench = false

[features]
preserve_order = ["linked-hash-map", "linked-hash-map/serde_impl"]
default = ["preserve_order"]
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-parser/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-parser"
version = "0.75.1"

[lib]
bench = false

[dependencies]
bytesize = "1.1.0"
chrono = { default-features = false, features = ['std'], version = "0.4.23" }
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-path/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-path"
version = "0.75.1"

[lib]
bench = false

[dependencies]
dirs-next = "2.0.0"

Expand Down
3 changes: 3 additions & 0 deletions crates/nu-plugin/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-plugin"
version = "0.75.1"

[lib]
bench = false

[dependencies]
bincode = "1.3.3"
nu-protocol = { path = "../nu-protocol", version = "0.75.1" }
Expand Down
1 change: 1 addition & 0 deletions crates/nu-pretty-hex/Cargo.toml
Expand Up @@ -11,6 +11,7 @@ version = "0.75.1"
doctest = false
name = "nu_pretty_hex"
path = "src/lib.rs"
bench = false

[dependencies]
nu-ansi-term = "0.46.0"
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-protocol/Cargo.toml
Expand Up @@ -9,6 +9,9 @@ version = "0.75.1"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
bench = false

[dependencies]
nu-utils = { path = "../nu-utils", version = "0.75.1" }
nu-json = { path = "../nu-json", version = "0.75.1" }
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-system/Cargo.toml
Expand Up @@ -9,6 +9,9 @@ license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
bench = false

[dependencies]
libc = "0.2"
log = "0.4"
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-table/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-table"
version = "0.75.1"

[lib]
bench = false

[dependencies]
nu-ansi-term = "0.46.0"
nu-protocol = { path = "../nu-protocol", version = "0.75.1" }
Expand Down
3 changes: 3 additions & 0 deletions crates/nu-term-grid/Cargo.toml
Expand Up @@ -7,6 +7,9 @@ license = "MIT"
name = "nu-term-grid"
version = "0.75.1"

[lib]
bench = false

[dependencies]
unicode-width = "0.1.9"

Expand Down
1 change: 1 addition & 0 deletions crates/nu-test-support/Cargo.toml
Expand Up @@ -9,6 +9,7 @@ version = "0.75.1"

[lib]
doctest = false
bench = false

[dependencies]
nu-path = { path="../nu-path", version = "0.75.1" }
Expand Down
4 changes: 4 additions & 0 deletions crates/nu-utils/Cargo.toml
Expand Up @@ -11,6 +11,10 @@ version = "0.75.1"
[[bin]]
name = "utils"
path = "src/main.rs"
bench = false

[lib]
bench = false

[dependencies]
log = "0.4"
Expand Down
3 changes: 3 additions & 0 deletions crates/nu_plugin_custom_values/Cargo.toml
Expand Up @@ -5,6 +5,9 @@ version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "nu_plugin_custom_values"
bench = false

[dependencies]
nu-plugin = { path = "../nu-plugin", version = "0.75.1" }
Expand Down
7 changes: 7 additions & 0 deletions crates/nu_plugin_example/Cargo.toml
Expand Up @@ -7,6 +7,13 @@ license = "MIT"
name = "nu_plugin_example"
version = "0.75.1"

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

[lib]
bench = false

[dependencies]
nu-plugin = { path="../nu-plugin", version = "0.75.1" }
nu-protocol = { path="../nu-protocol", version = "0.75.1", features = ["plugin"]}
5 changes: 5 additions & 0 deletions crates/nu_plugin_gstat/Cargo.toml
Expand Up @@ -9,6 +9,11 @@ version = "0.75.1"

[lib]
doctest = false
bench = false

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

[dependencies]
nu-plugin = { path="../nu-plugin", version = "0.75.1" }
Expand Down
5 changes: 5 additions & 0 deletions crates/nu_plugin_inc/Cargo.toml
Expand Up @@ -9,6 +9,11 @@ version = "0.75.1"

[lib]
doctest = false
bench = false

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

[dependencies]
nu-plugin = { path="../nu-plugin", version = "0.75.1" }
Expand Down
6 changes: 6 additions & 0 deletions crates/nu_plugin_query/Cargo.toml
Expand Up @@ -9,6 +9,12 @@ version = "0.75.1"

[lib]
doctest = false
bench = false

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


[dependencies]
nu-plugin = { path="../nu-plugin", version = "0.75.1" }
Expand Down

0 comments on commit 1d5e1f9

Please sign in to comment.