Skip to content

Commit 9fa6319

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 9fa6319

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

iotdb-core/ainode/build_binary.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,14 @@ 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(
337+
part in excluded_dirs for part in f.relative_to(script_dir).parts
338+
):
339+
hash_targets.append(f)
334340

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

0 commit comments

Comments
 (0)