Skip to content

v1.5.2 — Windows zccache em++/emcc hotfix

Choose a tag to compare

@zackees zackees released this 19 May 06:19
· 21 commits to main since this release
fd5ffa7

Hotfix for #29.

What was broken

In 1.5.1 on Windows, clang-tool-chain-em-cpp / -emcc / -zccache-em-cpp / -zccache-emcc all failed with:

zccache: failed to run em++.py: %1 is not a valid Win32 application. (os error 193)

The baked profile.json pointed at .py paths; Windows CreateProcess can't exec a Python script directly (no shebang support).

What changed

Three layered fixes — minimum needed for both fresh installs and existing 1.5.0 / 1.5.1 deployments:

  1. profile.py: bake the right entry point per platform.
    • Windows → emcc.bat / em++.bat (the wrapper Emscripten ships; cmd.exe handles python emcc.py)
    • POSIX → emcc / em++ (shebang scripts that exec directly)
  2. zccache_shim._resolve_tool_path: for back-compat with 1.5.0 / 1.5.1 profiles that already baked .py paths, rewrite to the sibling .bat at exec time on Windows. Existing installs auto-recover — no reinstall required. If no .bat fallback exists, fail with a clear error instead of the cryptic Win32 message.
  3. exec_via_zccache: for tool in {emcc, em++, wasm-ld}, set EM_CONFIG / EMSCRIPTEN / EMSCRIPTEN_ROOT env, prepend <emsdk>/bin to PATH for llvm-* discovery, and skip host-ABI flag injection (these tools are wasm-targeted; --target=*-windows-gnu etc. are wrong).

Verification

The exact repro from #29 now passes:

clang-tool-chain-em-cpp -c t.cpp -o t.o -O0   # rc=0, 540-byte .o produced

8 new regression tests (2 unit + 6 entry-point integration). 138 tests across the broader emscripten + version suites. Lint green.

Install

pip install --upgrade clang-tool-chain

Users on 1.5.1 are recommended to upgrade. Users on 1.5.0 / 1.5.1 who don't upgrade will still get the shim's .py.bat back-compat path the next time they run clang-tool-chain install ... (which rebakes profile.json) — but the shim fix is only in 1.5.2+, so you need to upgrade the package itself to get it.

🤖 Generated with Claude Code