Project 13: Build System / Task Runner

A custom build system / task runner (like Make or Just) written in Odin, with parallel execution, dependency tracking, and file watching for auto-rebuild.

Quick Reference

Attribute Value
Primary Language Odin
Alternative Languages Go, Rust
Difficulty Level 2: Intermediate
Time Estimate 1-2 weeks
Knowledge Area Developer Tools / Automation
Tooling Odin’s os and os/os2 packages
Prerequisites Basic understanding of build systems

What You Will Build

A custom build system / task runner (like Make or Just) written in Odin, with parallel execution, dependency tracking, and file watching for auto-rebuild.

Why It Matters

This project builds core skills that appear repeatedly in real-world systems and tooling.

Core Challenges

  • Parsing build definitions → maps to file parsing in Odin
  • Dependency graph execution → maps to algorithms in Odin
  • Parallel task execution → maps to Odin’s thread package
  • File watching → maps to OS-specific APIs

Key Concepts

  • Process Execution: core:os, core:os/os2
  • Threading: core:thread
  • File System: core:os, core:path/filepath
  • Dependency Graphs: Topological sorting

Real-World Outcome

$ odin run oddo  # Our build tool is called "oddo"

# Create a build file
$ cat build.oddo
project "my_game"

task build {
    depends: [assets]
    run: "odin build src -out:game.exe"
}

task assets {
    sources: ["assets/**/*.png", "assets/**/*.wav"]
    run: "asset_packer pack assets/ assets.pak"
}

task run {
    depends: [build]
    run: "./game.exe"
}

task clean {
    run: "rm -rf build/ game.exe assets.pak"
}

task watch {
    depends: [build]
    watch: ["src/**/*.odin"]
    on_change: [build, run]
}

$ oddo build
[oddo] Running task: assets
[oddo] Packing 47 assets...
[oddo] Running task: build
[oddo] Compiling src/ -> game.exe
[oddo] Done in 1.2s

$ oddo watch
[oddo] Watching src/**/*.odin
[oddo] Initial build...
[oddo] Waiting for changes...

# Edit a file in another terminal
[oddo] Changed: src/game.odin
[oddo] Rebuilding...
[oddo] Running game.exe...

$ oddo -j4 all  # Parallel execution
[oddo] Running 4 tasks in parallel...
[████████████████████] 100% (4/4 tasks)

Implementation Guide

  1. Reproduce the simplest happy-path scenario.
  2. Build the smallest working version of the core feature.
  3. Add input validation and error handling.
  4. Add instrumentation/logging to confirm behavior.
  5. Refactor into clean modules with tests.

Milestones

  • Milestone 1: Minimal working program that runs end-to-end.
  • Milestone 2: Correct outputs for typical inputs.
  • Milestone 3: Robust handling of edge cases.
  • Milestone 4: Clean structure and documented usage.

Validation Checklist

  • Output matches the real-world outcome example
  • Handles invalid inputs safely
  • Provides clear errors and exit codes
  • Repeatable results across runs

References

  • Main guide: LEARN_ODIN_PROGRAMMING_LANGUAGE.md
  • “The Pragmatic Programmer” by Hunt & Thomas