Commit a014323
fix: ignore stale substep timestamps when computing target compilation duration (#249)
* fix: ignore stale substep timestamps when computing target compilation duration
For incremental builds, Xcode reuses substep entries from previous build
sessions for files that don't need recompilation. Those substeps keep
their original (older) timestamps and are not flagged
`wasFetchedFromCache`. The previous logic in `addCompilationTimesToTarget`
took the latest substep `compilationEndTimestamp` regardless of whether
it actually ran in this build session, which produced a negative
`compilationDuration` whenever the chosen substep predated the target's
`startTimestamp`.
Filter out such stale substeps by requiring
`compilationEndTimestamp >= parent.startTimestamp` in both
`addCompilationTimesToTarget` and `addCompilationTimesToApp`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: fortmarek <marekfort@me.com>
* fix: keep ParserBuildSteps.swift under the 400-line SwiftLint limit
Inline the new filter clause across two lines instead of expanding it
into a four-line block, so the file stays at 400 lines (the SwiftLint
file_length limit).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: fortmarek <marekfort@me.com>
---------
Signed-off-by: fortmarek <marekfort@me.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3285807 commit a014323
2 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| |||
385 | 386 | | |
386 | 387 | | |
387 | 388 | | |
388 | | - | |
| 389 | + | |
| 390 | + | |
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
349 | 374 | | |
350 | 375 | | |
351 | 376 | | |
| |||
0 commit comments