From 0ab85f0e2fa024cb0870dc15daafb59b3f95cb3d Mon Sep 17 00:00:00 2001 From: fys Date: Fri, 23 Aug 2024 17:00:57 +0800 Subject: [PATCH] chore: optimize common_version build --- src/common/version/build.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/version/build.rs b/src/common/version/build.rs index 73089d68cc57..7b784d50859c 100644 --- a/src/common/version/build.rs +++ b/src/common/version/build.rs @@ -19,7 +19,11 @@ use build_data::{format_timestamp, get_source_time}; use shadow_rs::{CARGO_METADATA, CARGO_TREE}; fn main() -> shadow_rs::SdResult<()> { - println!("cargo:rerun-if-changed=../../../.git/refs/heads"); + println!( + "cargo:rerun-if-changed={}/.git/refs/heads", + env!("CARGO_RUSTC_CURRENT_DIR") + ); + println!( "cargo:rustc-env=SOURCE_TIMESTAMP={}", if let Ok(t) = get_source_time() {