diff --git a/runtime/src/autocompile.c b/runtime/src/autocompile.c index 998bb77d..b8ebf17c 100644 --- a/runtime/src/autocompile.c +++ b/runtime/src/autocompile.c @@ -532,9 +532,16 @@ int autocompile_request(void) { SetEnvironmentVariableA("PSX_OVERLAY_LIVE_AUTOCOMPILE", "1"); /* cmd.exe /C resolves the command via PATH and supports the relative - * paths in the configured line (cwd = project root). */ + * paths in the configured line (cwd = project root). The WHOLE command is + * wrapped in one extra pair of quotes: when the line after /C BEGINS with + * a quote and contains further quotes (a quoted interpreter path plus + * quoted args), cmd.exe strips the first and last quote characters and + * mangles the line ("The filename, directory name, or volume label syntax + * is incorrect" — every autocompile run failed and the reshard silently + * never happened). With the outer quotes cmd strips exactly those two and + * executes the inner command verbatim. */ char full[4200]; - snprintf(full, sizeof(full), "cmd.exe /C %s", s_cmd); + snprintf(full, sizeof(full), "cmd.exe /C \"%s\"", s_cmd); STARTUPINFOA si; memset(&si, 0, sizeof(si)); diff --git a/tools/launch_tomba2_interp_perf.ps1 b/tools/launch_tomba2_interp_perf.ps1 index e7567113..ddcea7ca 100644 --- a/tools/launch_tomba2_interp_perf.ps1 +++ b/tools/launch_tomba2_interp_perf.ps1 @@ -85,8 +85,16 @@ foreach ($dir in @($stateDir, (Split-Path $capturePath -Parent), $runDir, $logDi New-Item -ItemType Directory -Force -Path $dir | Out-Null } +# Windows Python EXPLICITLY (never unqualified 'python'): the game process +# inherits whatever PATH the launching shell had, and an MSYS python first on +# PATH cannot open the Windows-style script path — every autocompile run then +# fails with "can't open file" and the reshard silently never happens. +$windowsPython = Join-Path $env:LOCALAPPDATA 'Programs\Python\Python312\python.exe' +if (-not (Test-Path -LiteralPath $windowsPython -PathType Leaf)) { + throw "Windows Python not found at $windowsPython (required for autocompile)." +} $autoCompile = @( - 'python', (Quote-ProcessArgument $compileTool), + (Quote-ProcessArgument $windowsPython), (Quote-ProcessArgument $compileTool), '--captures', (Quote-ProcessArgument $capturePath), '--game-toml', (Quote-ProcessArgument $gameConfig), '--recompiler', (Quote-ProcessArgument $recompiler),