Skip to content

Commit e7e289b

Browse files
staging-devin-ai-integration[bot]streamkit-devinstreamer45
authored
fix(build): resolve incorrect git ref path causing unnecessary recompilation (#56)
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: StreamKit Devin <devin@streamkit.dev> Co-authored-by: Claudio Costa <cstcld91@gmail.com>
1 parent 4bd0d2f commit e7e289b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/skit/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ fn main() {
2323

2424
if let Ok(head_ref) = fs::read_to_string(head_path) {
2525
if let Some(reference) = head_ref.trim().strip_prefix("ref: ") {
26-
if let Some(repo_root) = head_path.parent().and_then(|dir| dir.parent()) {
27-
let ref_path = repo_root.join(reference);
26+
if let Some(git_dir) = head_path.parent() {
27+
let ref_path = git_dir.join(reference);
2828
println!("cargo:rerun-if-changed={}", ref_path.display());
2929
}
3030
}

0 commit comments

Comments
 (0)