From d2a00a2daa1d0ddf0f6b3ef4c6f5be6a23c760c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rust=E5=A4=A7=E9=97=B8=E8=9F=B9?= Date: Thu, 24 Dec 2020 00:56:05 +0800 Subject: [PATCH] update to shadow-rs 0.5. make use easy (#2793) * update to shadow-rs 0.4. use easy * update shadow-rs to 0.5 * fix version not used * update * update Cargo.lock * update Cargo.lock * fix wasm build error when use dependence git2 fix error link:https://dev.azure.com/nushell/nushell/_build/results?buildId=4858&view=logs&j=1a745d4c-b027-5f34-06d8-d6f256bfe9f9&t=a0a335cb-fa1f-5bbf-be01-1a90d6899e54 --- Cargo.lock | 12 ++++++------ crates/nu-cli/Cargo.toml | 2 +- crates/nu-cli/build.rs | 5 +---- crates/nu-cli/src/commands/version.rs | 3 +++ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc8ab22bbc..9b369e0542 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1919,9 +1919,9 @@ checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" [[package]] name = "git2" -version = "0.13.12" +version = "0.13.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6f1a0238d7f8f8fd5ee642f4ebac4dbc03e03d1f78fbe7a3ede35dcf7e2224" +checksum = "802b535f89475f22bb2b3d589de07861417e67b1a358c7ec8e5005bf4f209133" dependencies = [ "bitflags", "libc", @@ -2573,9 +2573,9 @@ checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" [[package]] name = "libgit2-sys" -version = "0.12.14+1.1.0" +version = "0.12.15+1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f25af58e6495f7caf2919d08f212de550cfa3ed2f5e744988938ea292b9f549" +checksum = "48c39622f3887bc7fb2fff6d06293f64b02c1dfa281212566ac155171d13b0eb" dependencies = [ "cc", "libc", @@ -5183,9 +5183,9 @@ dependencies = [ [[package]] name = "shadow-rs" -version = "0.3.20" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa99d59fca26677e3582f69069226abb6b2ce7e02d1068bcfd57510fa16ab87" +checksum = "b5ee6ecc8237a62951c2e5c871aa86799ba8a9bf909b5567129858039ae63e87" dependencies = [ "chrono", "git2", diff --git a/crates/nu-cli/Cargo.toml b/crates/nu-cli/Cargo.toml index 8902eef7c8..9652f144ec 100644 --- a/crates/nu-cli/Cargo.toml +++ b/crates/nu-cli/Cargo.toml @@ -118,7 +118,7 @@ optional = true version = "0.24.2" [build-dependencies] -shadow-rs = "0.3.20" +shadow-rs = "0.5" [dev-dependencies] quickcheck = "0.9.2" diff --git a/crates/nu-cli/build.rs b/crates/nu-cli/build.rs index fc8ddfcf99..4a0dfc4591 100644 --- a/crates/nu-cli/build.rs +++ b/crates/nu-cli/build.rs @@ -1,6 +1,3 @@ fn main() -> shadow_rs::SdResult<()> { - let src_path = std::env::var("CARGO_MANIFEST_DIR")?; - let out_path = std::env::var("OUT_DIR")?; - shadow_rs::Shadow::build(src_path, out_path)?; - Ok(()) + shadow_rs::new() } diff --git a/crates/nu-cli/src/commands/version.rs b/crates/nu-cli/src/commands/version.rs index e2aed25dd9..e015db5d87 100644 --- a/crates/nu-cli/src/commands/version.rs +++ b/crates/nu-cli/src/commands/version.rs @@ -7,6 +7,7 @@ use nu_protocol::{value::StrExt, value::StringExt, Dictionary, Signature, Untagg pub mod shadow { include!(concat!(env!("OUT_DIR"), "/shadow.rs")); } + pub struct Version; #[async_trait] @@ -152,6 +153,8 @@ pub fn version(args: CommandArgs) -> Result { // } let _project_name = shadow::PROJECT_NAME; + let _version = shadow::version(); + let build_time: Option<&str> = Some(shadow::BUILD_TIME).filter(|x| !x.is_empty()); if let Some(build_time) = build_time { indexmap.insert(