Commit be02dc5
committed
perf(P2): BMI copy_if_different — prevent cascade rebuilds
GCC always updates the .gcm (BMI) file's timestamp even when the
module interface hasn't changed. This causes all downstream modules
to be recompiled unnecessarily.
Fix: the cxx_module rule now backs up the BMI before compilation,
and if the new BMI is byte-identical to the backup, restores the
old file (preserving its timestamp). Combined with restat = 1 in
the per-file dyndep entries, ninja skips downstream modules when
only the implementation changed.
This means modifying a function body without changing the module
interface no longer triggers a cascade rebuild of all importers.1 parent c734bcd commit be02dc5
1 file changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
196 | 205 | | |
197 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
198 | 217 | | |
199 | 218 | | |
200 | 219 | | |
| |||
307 | 326 | | |
308 | 327 | | |
309 | 328 | | |
| 329 | + | |
310 | 330 | | |
311 | 331 | | |
312 | 332 | | |
| |||
320 | 340 | | |
321 | 341 | | |
322 | 342 | | |
323 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
324 | 349 | | |
325 | 350 | | |
326 | 351 | | |
| |||
0 commit comments