From cd05deaadf2b10eb2a22a893287dc45105481fb7 Mon Sep 17 00:00:00 2001 From: StreamKit Devin Date: Sun, 22 Feb 2026 11:55:51 +0000 Subject: [PATCH] fix(build): resolve incorrect git ref path causing unnecessary recompilation The build script was constructing the git ref path by joining the ref (e.g. refs/heads/main) to the repo root instead of the .git directory. This produced a non-existent path like /repo/refs/heads/main instead of /repo/.git/refs/heads/main. Since cargo treats a missing rerun-if-changed file as always stale, streamkit-server was recompiled on every build even with no code changes. Fix: use head_path.parent() (the .git dir) instead of going up two levels to the repo root. Co-Authored-By: Claudio Costa --- apps/skit/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/skit/build.rs b/apps/skit/build.rs index b50a4c6b..56eb3466 100644 --- a/apps/skit/build.rs +++ b/apps/skit/build.rs @@ -23,8 +23,8 @@ fn main() { if let Ok(head_ref) = fs::read_to_string(head_path) { if let Some(reference) = head_ref.trim().strip_prefix("ref: ") { - if let Some(repo_root) = head_path.parent().and_then(|dir| dir.parent()) { - let ref_path = repo_root.join(reference); + if let Some(git_dir) = head_path.parent() { + let ref_path = git_dir.join(reference); println!("cargo:rerun-if-changed={}", ref_path.display()); } }