From 8e538c650e3009fcbbda31bacf1fb82e5a40f84c Mon Sep 17 00:00:00 2001 From: WMR Date: Mon, 22 May 2023 08:42:38 -0700 Subject: [PATCH] Fix version to show build features after crateification (#9262) # Description Addresses missing features per #9261 # User-Facing Changes Fixes output of version. Adds wasi feature output # Tests + Formatting No tests written Co-authored-by: Robert Waugh --- Cargo.toml | 14 +++++++------- crates/nu-cmd-lang/Cargo.toml | 10 ++++++++++ crates/nu-cmd-lang/src/core_commands/version.rs | 5 +++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b15982478..83d284e25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,25 +108,25 @@ plugin = [ "nu-engine/plugin", ] # extra used to be more useful but now it's the same as default. Leaving it in for backcompat with existing build scripts -extra = ["default"] +extra = ["default", "nu-cmd-lang/extra"] default = ["plugin", "which-support", "trash-support", "sqlite"] stable = ["default"] -wasi = [] +wasi = ["nu-cmd-lang/wasi"] # Enable to statically link OpenSSL; otherwise the system version will be used. Not enabled by default because it takes a while to build -static-link-openssl = ["dep:openssl"] +static-link-openssl = ["dep:openssl", "nu-cmd-lang/static-link-openssl"] # Stable (Default) -which-support = ["nu-command/which-support"] -trash-support = ["nu-command/trash-support"] +which-support = ["nu-command/which-support", "nu-cmd-lang/which-support"] +trash-support = ["nu-command/trash-support", "nu-cmd-lang/trash-support"] # Extra # Dataframe feature for nushell -dataframe = ["nu-command/dataframe"] +dataframe = ["nu-command/dataframe", "nu-cmd-lang/dataframe"] # SQLite commands for nushell -sqlite = ["nu-command/sqlite"] +sqlite = ["nu-command/sqlite", "nu-cmd-lang/sqlite"] [profile.release] opt-level = "s" # Optimize for size diff --git a/crates/nu-cmd-lang/Cargo.toml b/crates/nu-cmd-lang/Cargo.toml index 4be833c61..24bb6c9c6 100644 --- a/crates/nu-cmd-lang/Cargo.toml +++ b/crates/nu-cmd-lang/Cargo.toml @@ -25,3 +25,13 @@ shadow-rs = { version = "0.21.0", default-features = false } [build-dependencies] shadow-rs = { version = "0.21.0", default-features = false } + +[features] +which-support = [] +trash-support = [] +sqlite = [] +dataframe = [] +static-link-openssl = [] +extra = [] +wasi = [] + diff --git a/crates/nu-cmd-lang/src/core_commands/version.rs b/crates/nu-cmd-lang/src/core_commands/version.rs index a4e77920a..ed556774b 100644 --- a/crates/nu-cmd-lang/src/core_commands/version.rs +++ b/crates/nu-cmd-lang/src/core_commands/version.rs @@ -182,6 +182,11 @@ fn features_enabled() -> Vec { names.push("extra".to_string()); } + #[cfg(feature = "wasi")] + { + names.push("wasi".to_string()); + } + names.sort(); names