Skip to content

Commit 28d4a8b

Browse files
committed
Fix PyInstaller cache hash mismatch by excluding build/dist directories
The compute_source_hash() function was including files from the build/ directory (generated by PyInstaller during the same run), causing the hash computed at check time (before build/) to differ from the hash at save time (after build/ exists). This made the cache always miss. Fix: exclude build/, dist/, and __pycache__/ from the hash computation. These are all build artifacts that don't affect the PyInstaller input.
1 parent 65f98a7 commit 28d4a8b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

iotdb-core/ainode/build_binary.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,12 @@ def compute_source_hash(script_dir):
329329

330330
hash_targets = []
331331

332+
excluded_dirs = {"build", "dist", "__pycache__"}
333+
332334
for pattern in ("**/*.py", "**/*.spec"):
333-
hash_targets.extend(script_dir.glob(pattern))
335+
for f in script_dir.glob(pattern):
336+
if not any(part in excluded_dirs for part in f.relative_to(script_dir).parts):
337+
hash_targets.append(f)
334338

335339
for name in ("pyproject.toml", "poetry.lock"):
336340
f = script_dir / name

0 commit comments

Comments
 (0)