Skip to content

fix(tools): a dirty flag that fired on scratch files - #265

Merged
Nghaiz merged 1 commit into
developfrom
fix/build-stamp-dirty-scope
Sep 6, 2026
Merged

fix(tools): a dirty flag that fired on scratch files#265
Nghaiz merged 1 commit into
developfrom
fix/build-stamp-dirty-scope

Conversation

@Nghaiz

@Nghaiz Nghaiz commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Follow-up to #264, found by running the mechanism rather than by reading it.

The first real build off the new stamp reported 502d45a-dirty and printed "this
binary does NOT match its commit"
. The binary matched its commit exactly. The
culprits were tmp/editmode-new.xml and tmp/editmode-resend.xml — untracked
test-result scratch that cannot enter a player build by any path.

The check asked git status --porcelain over the whole tree. The question it is
actually asking is "does this SHA describe the code in this binary", and only
Ironfront_Reborn/ becomes the binary — Assets (including the prebuilt
Ironfront.Net.* DLLs under Assets/Plugins), Packages and ProjectSettings.

Why this is worth a commit and not a shrug

The flag exists so a reader can tell a SHA that describes the binary from one that
does not. Firing on scratch makes it fire on nearly every build, and a warning
that is always on is one nobody reads by the second day — at which point the one
build where it matters says exactly what every other build said. BuildStampTests
makes this argument about the mismatch error in its own remark; the first run
proved it applies here too.

Measured in both directions

Same machine, same commit:

Tree state Stamp printed
untracked tmp/*.xml 502d45a-dirty + warning — false alarm
uncommitted tools/ + docs/ edits 502d45a, silent — correct

And the second build still stamps: the new Ironfront.Net.Unity.Server.dll carries
2026-09-06T10:03:18Z and not the earlier 09:58:40Z, so the assemblies were
genuinely recompiled and the stamp tracks each build rather than being copied
forward.

End-to-end proof the stamp works at all

While confirming this, the mechanism was verified in a built binary for the first
time — 502d45a appears exactly once in both Ironfront.Net.Unity.Server.dll and
Ironfront.Net.Unity.Shared.dll, the literal dev is gone from both (so the
substitution is total, not additive), and git status is clean afterwards (the
finally restored the sources).

One note for anyone repeating that check: strings defaults to ASCII and .NET
stores string literals as UTF-16, so a naive probe returns 0 on a perfectly good
DLL. Use strings -a -e l, and confirm the probe against a literal you know is
there before trusting a zero.

Found by running the thing rather than by reading it. The first real build off the
stamp mechanism (502d45a, 2026-09-06) reported itself as -dirty and printed the
"this binary does NOT match its commit" warning. The binary matched its commit
exactly. The two files responsible were tmp/editmode-new.xml and
tmp/editmode-resend.xml -- untracked test-result scratch that cannot enter a player
build by any path.

The check asked `git status --porcelain` over the whole tree. The question it is
actually asking is "does $commit describe the code in THIS BINARY", and only
Ironfront_Reborn/ becomes the binary: Assets (including the prebuilt Ironfront.Net.*
DLLs under Assets/Plugins), Packages and ProjectSettings. An artifacts/ run, a tmp/
scratch file, or an edit to this very script cannot change what Unity compiles.

WHY THIS IS WORTH A COMMIT RATHER THAN A SHRUG. The flag exists so a reader can tell
a SHA that describes the binary from one that does not. Firing it on scratch makes
it fire on nearly every build, and a warning that is always on is one nobody reads
by the second day -- at which point the one build where it matters says the same
thing every other build said. The BuildStampTests remark makes this exact argument
about the mismatch error; it applies here and the first run proved it.

MEASURED IN BOTH DIRECTIONS, on the same machine, same commit.
  before: untracked tmp/*.xml         -> "502d45a-dirty" + warning   (false alarm)
  after:  uncommitted tools/ + docs/  -> "502d45a", silent           (correct)
and the second build still stamps: the new Server.dll carries 2026-09-06T10:03:18Z
and NOT the earlier 09:58:40Z, so the assemblies were genuinely recompiled and the
stamp tracks each build rather than being copied forward.

The warning text now names the directory it checked, so a reader who disagrees with
the scope can see what it was.
@Nghaiz
Nghaiz merged commit 4d15454 into develop Sep 6, 2026
10 checks passed
@Nghaiz
Nghaiz deleted the fix/build-stamp-dirty-scope branch September 6, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant