Skip to content

Commit 24f9f8c

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 24f9f8c

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Generated source directories that need to be on the source path:
173173
### Code Style
174174

175175
- **Always run `mvn spotless:apply` after editing Java files**: Spotless runs `spotless:check` automatically during the `compile` phase. Format violations cause an immediate BUILD FAILURE. Make it a habit to run `mvn spotless:apply -pl <module>` right after editing, not at the end. For files under `integration-test/`, add `-P with-integration-tests`.
176+
- **Always run `black` and `isort` after editing Python files under `iotdb-core/ainode/`**: The AINode Code Style Check CI runs `black --check .` and `isort --check-only --profile black .` on that directory. Run `cd iotdb-core/ainode && black . && isort --profile black .` before committing. Requires `pip install black==25.1.0 isort==6.0.1`.
176177
- **Gson version compatibility**: `JsonObject.isEmpty()` / `JsonArray.isEmpty()` may not be available in the Gson version used by this project. Use `size() > 0` instead and add a comment explaining why.
177178

178179
## Git Commit

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)