From 3973d6b01f593794f68b6a0a43d0b6ce252fbe20 Mon Sep 17 00:00:00 2001 From: fys <40801205+fengys1996@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:36:28 +0800 Subject: [PATCH] chore: optimize common_version build (#4611) --- 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() {