From 468b00600836b38e63ae7436b0e020bc7cb7b67c Mon Sep 17 00:00:00 2001 From: funman300 Date: Tue, 11 Aug 2026 01:55:20 +0000 Subject: [PATCH] blaze-host: scope the dirty-tree check to the crates the binary is built from A whole-repo check read DIRTY permanently, because unrelated submodules carry pre-existing modifications. A warning that is always on is a warning nobody reads, which defeats the point: the flag exists so a mutated build announces itself before it can be mistaken for parity evidence. Co-Authored-By: Claude Opus 5 (1M context) --- openfut-blaze-host/build.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/openfut-blaze-host/build.rs b/openfut-blaze-host/build.rs index ec34228..4d33901 100644 --- a/openfut-blaze-host/build.rs +++ b/openfut-blaze-host/build.rs @@ -23,9 +23,24 @@ fn git(args: &[&str]) -> Option { fn main() { let commit = git(&["rev-parse", "--short=7", "HEAD"]).unwrap_or_else(|| "unknown".into()); - // Tracked modifications only: untracked scratch files are not a build - // difference, but an edited source file certainly is. - let dirty = match git(&["status", "--porcelain", "--untracked-files=no"]) { + // Scoped to the crates this binary is actually built from. + // + // A whole-repo check reads DIRTY permanently here, because unrelated + // submodules carry pre-existing modifications. A warning that is always on + // is a warning nobody reads — which would defeat the point, since the whole + // job of this flag is to make a mutated build announce itself. + // + // Untracked files are excluded: scratch output is not a build difference, + // but an edited source file certainly is. + let dirty = match git(&[ + "status", + "--porcelain", + "--untracked-files=no", + "--", + "openfut-blaze-host", + "openfut-adapter-fifa17", + "openfut-protocol-blaze", + ]) { Some(s) if !s.is_empty() => "DIRTY", Some(_) => "clean", None => "unknown",