From e83d059fc764c6794aa207a56ebb9545fbae5d1e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 23 Apr 2021 23:29:43 -0700 Subject: [PATCH] couple of build tweaks for git versioning and macos build perf --- Cargo.toml | 4 ++++ config/build.rs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index ab224c597..e352aaf19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,5 +12,9 @@ resolver = "2" opt-level = 3 # debug = 1 +[profile.dev] +# https://jakedeichert.com/blog/reducing-rust-incremental-compilation-times-on-macos-by-70-percent/ +split-debuginfo = "unpacked" + [patch.crates-io] ssh2 = { git = "https://github.com/wez/ssh2-rs.git", branch="win32ssl" } diff --git a/config/build.rs b/config/build.rs index 484537b60..35becffbf 100644 --- a/config/build.rs +++ b/config/build.rs @@ -68,6 +68,12 @@ fn main() { ci_tag = info.trim().to_string(); } } + + let index = Path::new("../.git/index"); + if index.exists() { + let index = index.canonicalize().unwrap(); + println!("cargo:rerun-if-changed={}", index.display()); + } } let target = std::env::var("TARGET").unwrap_or_else(|_| "unknown".to_string());