Commit 4df2b7b
committed
feat(ci): unify caching strategy across all build workflows
Implement consistent caching strategy across smol, SEA, and WASM builds:
**Unified Strategy:**
- Native C++ (smol): ccache + build directory cache
- WASM C++ (Yoga, ONNX): build directory cache only
- Non-C++ (AI, SEA): output cache only
**Changes:**
Smol build:
- Move cache key generation before ccache setup (needs hash first)
- Add build directory cache for CMake state and Node.js source
- Update ccache key to include content hash
- Preserves: ccache (object files) + build state (CMake)
Yoga build:
- Rename "Restore yoga build cache" → "Restore yoga output cache"
- Add build directory cache for CMake state and Yoga source
- Consistent with ONNX pattern
ONNX build:
- Already implemented (reference pattern)
**Benefits:**
- Consistent pattern across all C++ builds
- Better failure recovery (preserve intermediate state)
- Smol: Faster incremental builds with CMake cache
- Yoga: Faster rebuilds (though already fast at 2-3 min)
- ONNX: Already benefits from build cache (saves 30+ min on failures)
**Cache Layers:**
1. Build tools (Python, Ninja, Emscripten)
2. Source code (.node-source/, .yoga-source/, .onnx-source/)
3. Intermediate build (CMake cache, compiled objects)
4. Compilation cache (ccache, native only)
5. Final output (dist/ artifacts)1 parent a5adfd6 commit 4df2b7b
2 files changed
+30
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 84 | | |
92 | 85 | | |
93 | 86 | | |
94 | 87 | | |
95 | 88 | | |
96 | 89 | | |
97 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
65 | 76 | | |
66 | 77 | | |
67 | 78 | | |
| |||
0 commit comments