Commit 7c37b3d
authored
Fix hatch build proto staleness detection (#4078)
Replace mtime-based proto staleness check with SHA-256 content-hash
checksums in `lib/iris/hatch_build.py`
## Problem
Git does not preserve file modification times. After a `git pull`, both
proto source files and their generated outputs get the same mtime, which
means:
- Real changes to `.proto` files can be missed (no rebuild when one is
needed)
- Spurious rebuilds can be triggered when mtimes shift
The previous 60-second tolerance on mtime comparison was a workaround
for zip extraction jitter but did not address the fundamental git mtime
problem.
## Fix
- Compute a SHA-256 digest over all proto source file contents (sorted
by path for determinism)
- Store the digest in `build/.proto_checksum` after successful
generation
- On subsequent builds, compare the current digest against the stored
one
- Fall back to the old mtime comparison when no checksum file exists yet
(first build)1 parent 0abc41d commit 7c37b3d
1 file changed
Lines changed: 31 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
65 | 79 | | |
66 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
67 | 85 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 86 | + | |
| 87 | + | |
71 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
72 | 95 | | |
73 | 96 | | |
74 | 97 | | |
| |||
117 | 140 | | |
118 | 141 | | |
119 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
120 | 147 | | |
0 commit comments