Implement bot compiler and launcher #129

Closed
opened 2026-08-30 10:22:04 +02:00 by SirStone · 2 comments
Owner

Wayfinder child of: #126

Implement compilation of arbitrary .nim bot files and launching them as subprocesses pointed at the running server. Handle compilation errors, process lifecycle, cleanup.

Blocked by: nothing

Grilling Revisions

Compilation: nim c invoked from the garage root directory. The garage's config.nims (with --path:"../common_libs") applies automatically — no explicit path flags needed.

Bot directory generation: Framework auto-generates a temp directory per bot containing:

  • Compiled binary
  • JSON config: name from source filename, version: "1.0.0", gameTypes: ["classic"], optional initialPosition
  • Boot script (one-liner #!/bin/sh\nexec ./binary_name)

Cleanup: temp directories removed after test.

Errors: compilation failure surfaces compiler output clearly, test fails (not silent).

**Wayfinder child of:** #126 Implement compilation of arbitrary .nim bot files and launching them as subprocesses pointed at the running server. Handle compilation errors, process lifecycle, cleanup. **Blocked by:** nothing ### Grilling Revisions **Compilation**: `nim c` invoked from the garage root directory. The garage's `config.nims` (with `--path:"../common_libs"`) applies automatically — no explicit path flags needed. **Bot directory generation**: Framework auto-generates a temp directory per bot containing: - Compiled binary - JSON config: name from source filename, `version: "1.0.0"`, `gameTypes: ["classic"]`, optional `initialPosition` - Boot script (one-liner `#!/bin/sh\nexec ./binary_name`) **Cleanup**: temp directories removed after test. **Errors**: compilation failure surfaces compiler output clearly, test fails (not silent).
SirStone added the wayfinder:task label 2026-08-30 10:22:04 +02:00
Author
Owner

Spec additions from grilling

  • Use nim c directly, NOT nimble build (nimble swallows compiler output, making errors hard to diagnose).
  • Compilation timeout: 30s per bot.
  • Must handle --path flags for common_libs dependencies (e.g. radar_lock).
## Spec additions from grilling - Use `nim c` directly, NOT `nimble build` (nimble swallows compiler output, making errors hard to diagnose). - Compilation timeout: **30s** per bot. - Must handle `--path` flags for common_libs dependencies (e.g. radar_lock).
Author
Owner

Implemented in commit 57a1915.

Implemented in commit 57a1915.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#129