Skip to content

Commit cfa6995

Browse files
committed
Update 1 code files
Modified: • src/omnipkg/dispatcher.py (+10/-2 lines) [gitship-generated]
1 parent 499d467 commit cfa6995

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/omnipkg/dispatcher.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,10 +757,18 @@ def _ghost_spawn_windows(swaps: list, src_hash: str, debug: bool, marker_path=No
757757
print(f"[C-INSTALL] ghost: ghost.c not found in any candidate — cannot swap", file=sys.stderr)
758758
return
759759

760-
# ── Ghost exe cached by src_hash prefix in temp dir ───────────────────────
760+
# ── Ghost exe cached by ghost.c's OWN hash in temp dir ──────────────────
761+
# CRITICAL: cache key must be derived from ghost.c's content, NOT from
762+
# dispatcher.c's hash (src_hash). Using src_hash meant that fixing ghost.c
763+
# had no effect until dispatcher.c also changed — the cached ghost exe
764+
# filename stayed the same and `if not ghost_exe.exists()` skipped recompile.
761765
ghost_dir = Path(tempfile.gettempdir()) / "omnipkg"
762766
ghost_dir.mkdir(parents=True, exist_ok=True)
763-
ghost_tag = src_hash[:8] if src_hash else "nogit"
767+
try:
768+
ghost_self_hash = hashlib.md5(ghost_c_src.read_bytes()).hexdigest()[:8]
769+
except Exception:
770+
ghost_self_hash = src_hash[:8] if src_hash else "nogit"
771+
ghost_tag = ghost_self_hash
764772
ghost_exe = ghost_dir / f"omnipkg_ghost_{ghost_tag}.exe"
765773

766774
if not ghost_exe.exists():

0 commit comments

Comments
 (0)