How evmar/n2 works
Main Components
a) Core Build Engine Components:
• Parser Module (parse.rs, scanner.rs)
• Evaluation Engine (eval.rs)
• Task Execution System (task.rs, work.rs)
• Build Database (db.rs)
• Process Management (process.rs, process_posix.rs, process_win.rs)
b) Support Systems:
• Graph Management (graph.rs)
• Memory Management (densemap.rs, smallmap.rs)
• Progress Tracking (progress.rs, terminal.rs)
• Dependency Management (depfile.rs)
┌─ Input Layer ─────────────────────┐
• build.ninja files │
• ┬───────────────────┘
• ↓
┌─ Parse Layer ─────────────────────┐
• Scanner → Parser → Graph Builder │
• ┬───────────────────┘
• ↓
┌─ Core Engine Layer ────────────────┐
• ┌─────────────┐ ┌────────────┐ │
• Build Graph │←→ │Task Manager│ │
• ┘ └────────────┘ │
• ↕ ↕ │
• ┌─────────────┐ ┌────────────┐ │
• Evaluator │←→ │Process Mgr │ │
• ┘ └────────────┘ │
• ┬───────────────────┘
• ↓
┌─ Output Layer ────────────────────┐
• Progress UI / Build Artifacts │
• ┘
Key Relationships to Highlight
• Flow from input (build.ninja files) through parsing to execution
• Interaction between the task manager and process management
• Demonstrate how the build graph interfaces with the evaluation engine
• Progress reporting system's integration
Technical Details
• Rust-specific implementation details (use of traits, async patterns)
• File system interaction points
• Cross-platform compatibility layers
• Performance-critical paths