From 1cd70d7505d0ed601333ff2a9c23e78ad45750f3 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Sun, 12 Feb 2023 23:22:00 +0100 Subject: [PATCH] Disable auto-benchmark harness for crates (#8057) # Description 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 https://github.com/nushell/nushell/pull/7952 See: https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options # User-Facing Changes None --- Cargo.toml | 1 + crates/nu-cli/Cargo.toml | 3 +++ crates/nu-color-config/Cargo.toml | 3 +++ crates/nu-command/Cargo.toml | 3 +++ crates/nu-engine/Cargo.toml | 3 +++ crates/nu-explore/Cargo.toml | 3 +++ crates/nu-glob/Cargo.toml | 3 +++ crates/nu-json/Cargo.toml | 3 +++ crates/nu-parser/Cargo.toml | 3 +++ crates/nu-path/Cargo.toml | 3 +++ crates/nu-plugin/Cargo.toml | 3 +++ crates/nu-pretty-hex/Cargo.toml | 1 + crates/nu-protocol/Cargo.toml | 3 +++ crates/nu-system/Cargo.toml | 3 +++ crates/nu-table/Cargo.toml | 3 +++ crates/nu-term-grid/Cargo.toml | 3 +++ crates/nu-test-support/Cargo.toml | 1 + crates/nu-utils/Cargo.toml | 4 ++++ crates/nu_plugin_custom_values/Cargo.toml | 3 +++ crates/nu_plugin_example/Cargo.toml | 7 +++++++ crates/nu_plugin_gstat/Cargo.toml | 5 +++++ crates/nu_plugin_inc/Cargo.toml | 5 +++++ crates/nu_plugin_query/Cargo.toml | 6 ++++++ 23 files changed, 75 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 6dda29168..cef98a101 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/crates/nu-cli/Cargo.toml b/crates/nu-cli/Cargo.toml index 6618171da..7e068ccc7 100644 --- a/crates/nu-cli/Cargo.toml +++ b/crates/nu-cli/Cargo.toml @@ -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" } diff --git a/crates/nu-color-config/Cargo.toml b/crates/nu-color-config/Cargo.toml index c91679125..1e5e71140 100644 --- a/crates/nu-color-config/Cargo.toml +++ b/crates/nu-color-config/Cargo.toml @@ -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 diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index 443601f39..d05530670 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -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" } diff --git a/crates/nu-engine/Cargo.toml b/crates/nu-engine/Cargo.toml index f5ca88af8..af65a21ce 100644 --- a/crates/nu-engine/Cargo.toml +++ b/crates/nu-engine/Cargo.toml @@ -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" } diff --git a/crates/nu-explore/Cargo.toml b/crates/nu-explore/Cargo.toml index 933c5c883..932bbde82 100644 --- a/crates/nu-explore/Cargo.toml +++ b/crates/nu-explore/Cargo.toml @@ -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" } diff --git a/crates/nu-glob/Cargo.toml b/crates/nu-glob/Cargo.toml index df0e1df1a..6d3fa3252 100644 --- a/crates/nu-glob/Cargo.toml +++ b/crates/nu-glob/Cargo.toml @@ -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" \ No newline at end of file diff --git a/crates/nu-json/Cargo.toml b/crates/nu-json/Cargo.toml index b250eb79c..d096416fb 100644 --- a/crates/nu-json/Cargo.toml +++ b/crates/nu-json/Cargo.toml @@ -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"] diff --git a/crates/nu-parser/Cargo.toml b/crates/nu-parser/Cargo.toml index 76cb74b53..5c97374e1 100644 --- a/crates/nu-parser/Cargo.toml +++ b/crates/nu-parser/Cargo.toml @@ -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" } diff --git a/crates/nu-path/Cargo.toml b/crates/nu-path/Cargo.toml index 5c4064650..f8e8c1314 100644 --- a/crates/nu-path/Cargo.toml +++ b/crates/nu-path/Cargo.toml @@ -7,6 +7,9 @@ license = "MIT" name = "nu-path" version = "0.75.1" +[lib] +bench = false + [dependencies] dirs-next = "2.0.0" diff --git a/crates/nu-plugin/Cargo.toml b/crates/nu-plugin/Cargo.toml index 04f4de2e5..a5e7202bf 100644 --- a/crates/nu-plugin/Cargo.toml +++ b/crates/nu-plugin/Cargo.toml @@ -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" } diff --git a/crates/nu-pretty-hex/Cargo.toml b/crates/nu-pretty-hex/Cargo.toml index 321980c76..5164dc2da 100644 --- a/crates/nu-pretty-hex/Cargo.toml +++ b/crates/nu-pretty-hex/Cargo.toml @@ -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" diff --git a/crates/nu-protocol/Cargo.toml b/crates/nu-protocol/Cargo.toml index 4d7127cc3..88fb6453e 100644 --- a/crates/nu-protocol/Cargo.toml +++ b/crates/nu-protocol/Cargo.toml @@ -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" } diff --git a/crates/nu-system/Cargo.toml b/crates/nu-system/Cargo.toml index e3344f932..c6faafec1 100644 --- a/crates/nu-system/Cargo.toml +++ b/crates/nu-system/Cargo.toml @@ -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" diff --git a/crates/nu-table/Cargo.toml b/crates/nu-table/Cargo.toml index 00ce02cba..493fb4239 100644 --- a/crates/nu-table/Cargo.toml +++ b/crates/nu-table/Cargo.toml @@ -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" } diff --git a/crates/nu-term-grid/Cargo.toml b/crates/nu-term-grid/Cargo.toml index c15089138..e4f11f5fd 100644 --- a/crates/nu-term-grid/Cargo.toml +++ b/crates/nu-term-grid/Cargo.toml @@ -7,6 +7,9 @@ license = "MIT" name = "nu-term-grid" version = "0.75.1" +[lib] +bench = false + [dependencies] unicode-width = "0.1.9" diff --git a/crates/nu-test-support/Cargo.toml b/crates/nu-test-support/Cargo.toml index 1acefaaed..b220692b4 100644 --- a/crates/nu-test-support/Cargo.toml +++ b/crates/nu-test-support/Cargo.toml @@ -9,6 +9,7 @@ version = "0.75.1" [lib] doctest = false +bench = false [dependencies] nu-path = { path="../nu-path", version = "0.75.1" } diff --git a/crates/nu-utils/Cargo.toml b/crates/nu-utils/Cargo.toml index 7415c7258..b168ce462 100644 --- a/crates/nu-utils/Cargo.toml +++ b/crates/nu-utils/Cargo.toml @@ -11,6 +11,10 @@ version = "0.75.1" [[bin]] name = "utils" path = "src/main.rs" +bench = false + +[lib] +bench = false [dependencies] log = "0.4" diff --git a/crates/nu_plugin_custom_values/Cargo.toml b/crates/nu_plugin_custom_values/Cargo.toml index 1fa1575c2..3a7b73e9a 100644 --- a/crates/nu_plugin_custom_values/Cargo.toml +++ b/crates/nu_plugin_custom_values/Cargo.toml @@ -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" } diff --git a/crates/nu_plugin_example/Cargo.toml b/crates/nu_plugin_example/Cargo.toml index cd6aefc09..65f50afb2 100644 --- a/crates/nu_plugin_example/Cargo.toml +++ b/crates/nu_plugin_example/Cargo.toml @@ -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"]} diff --git a/crates/nu_plugin_gstat/Cargo.toml b/crates/nu_plugin_gstat/Cargo.toml index a898c4fc3..4a64c9961 100644 --- a/crates/nu_plugin_gstat/Cargo.toml +++ b/crates/nu_plugin_gstat/Cargo.toml @@ -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" } diff --git a/crates/nu_plugin_inc/Cargo.toml b/crates/nu_plugin_inc/Cargo.toml index 44df4bc5a..907272a4f 100644 --- a/crates/nu_plugin_inc/Cargo.toml +++ b/crates/nu_plugin_inc/Cargo.toml @@ -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" } diff --git a/crates/nu_plugin_query/Cargo.toml b/crates/nu_plugin_query/Cargo.toml index 1732a1988..20cbd41c1 100644 --- a/crates/nu_plugin_query/Cargo.toml +++ b/crates/nu_plugin_query/Cargo.toml @@ -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" }