From 5bf077d64f006a84e9bfde64e5b9004cecabb604 Mon Sep 17 00:00:00 2001 From: Michael Angerman <1809991+stormasm@users.noreply.github.com> Date: Wed, 1 Mar 2023 09:30:58 -0800 Subject: [PATCH] remove left over build.rs from nu-command (#8280) @fdncred pointed out to me that post creation of the nu-cmd-lang crate we probably don't need an extra build.rs file in nu-command any longer now that the version command (and build.rs) is located in nu-cmd-lang... I am removing the redundancy... --- crates/nu-command/Cargo.toml | 4 ---- crates/nu-command/build.rs | 20 -------------------- 2 files changed, 24 deletions(-) delete mode 100644 crates/nu-command/build.rs diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index 68c87aa4c9..dde10ed3b0 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -1,6 +1,5 @@ [package] authors = ["The Nushell Project Developers"] -build = "build.rs" description = "Nushell's built-in commands" edition = "2021" license = "MIT" @@ -155,9 +154,6 @@ sqlite = ["rusqlite"] # TODO: given that rusqlite is includ trash-support = ["trash"] which-support = ["which"] -[build-dependencies] -shadow-rs = { version = "0.20.0", default-features = false } - [dev-dependencies] nu-test-support = { path = "../nu-test-support", version = "0.76.1" } diff --git a/crates/nu-command/build.rs b/crates/nu-command/build.rs deleted file mode 100644 index 0d49abde0b..0000000000 --- a/crates/nu-command/build.rs +++ /dev/null @@ -1,20 +0,0 @@ -use std::process::Command; - -fn main() -> shadow_rs::SdResult<()> { - // Look up the current Git commit ourselves instead of relying on shadow_rs, - // because shadow_rs does it in a really slow-to-compile way (it builds libgit2) - let hash = get_git_hash().unwrap_or_default(); - println!("cargo:rustc-env=NU_COMMIT_HASH={hash}"); - - shadow_rs::new() -} - -fn get_git_hash() -> Option { - Command::new("git") - .args(["rev-parse", "HEAD"]) - .output() - .ok() - .filter(|output| output.status.success()) - .and_then(|output| String::from_utf8(output.stdout).ok()) - .map(|hash| hash.trim().to_string()) -}