Skip to content

fix(service): wrap Windows execution with cmd /c#9

Merged
dnzgrkn merged 1 commit into
masterfrom
fix/windows-run-command
May 16, 2026
Merged

fix(service): wrap Windows execution with cmd /c#9
dnzgrkn merged 1 commit into
masterfrom
fix/windows-run-command

Conversation

@dnzgrkn

@dnzgrkn dnzgrkn commented May 16, 2026

Copy link
Copy Markdown
Owner

…es from working dirJava's ProcessBuilder on Windows resolves command names against PATH
only — it does not search the working directory the way Unix shells
do. So even after CommandRunner.adaptForOs() translated "./main"
into "main.exe", Windows couldn't find the executable that gcc had
just produced in the per-submission temp working dir, and every run
failed with Cannot run program "main.exe" (in directory "...").

Fix: on Windows, prefix the execute() command with "cmd" "/c" so the
Windows shell handles resolution. Linux/macOS path unchanged.

Verified locally with the design-doc-standard runCommand "./main" and
Emre's six fixtures:

  • 20240001 → PASS
  • 20240002 → COMPILE_ERROR (gcc detects missing semicolon)
  • 20240003 → TIMEOUT (infinite loop killed after 10s)
  • 20240004 → FAIL (output mismatch detected by OutputComparator)
  • 20240005 → COMPILE_ERROR (source file not found)
  • 20240006 → COMPILE_ERROR (corrupt ZIP rejected by ZipExtractor)

Lets us ship examples/configurations/c_standard.json with the portable
"./main" rather than a Windows-only workaround.

@dnzgrkn
dnzgrkn merged commit 6a67481 into master May 16, 2026
@dnzgrkn
dnzgrkn deleted the fix/windows-run-command branch May 16, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant