Commit 02abbf8
fix: make BuildOperationMetrics fields tolerant of missing keys
Xcode projects using `betaFeature_enableExplicitModules` produce
xcactivitylog files where BuildOperationMetrics may not contain all
expected keys (e.g. clangCacheHits). This causes a DecodingError
when parsing these logs.
Add a custom Decodable initializer that uses decodeIfPresent with
a default of 0 for each field, so parsing succeeds even when keys
are absent.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: fortmarek <marekfort@me.com>1 parent 5c5b5bd commit 02abbf8
2 files changed
Lines changed: 38 additions & 4 deletions
File tree
- Sources/XCLogParser/activityparser
- Tests/XCLogParserTests
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
793 | 801 | | |
794 | 802 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
565 | 591 | | |
0 commit comments