Commit 0121ab2
fix: implement proper 2-step Android coverage workflow
Research showed we were missing the llvm-profdata merge step that
Android developers use. The correct workflow per Android documentation:
1. llvm-profdata merge: Convert profraw → profdata
2. llvm-cov export: Convert profdata → lcov
We were trying to use llvm-cov export directly on profraw files,
which causes "bad magic" errors because llvm-cov expects profdata.
The merge step is required even for single profraw files - it's not
just for combining multiple profiles, it's a necessary format conversion.
Using Swift toolchain's llvm-profdata and llvm-cov ensures version
compatibility since they match the clang that generated the profraw.
References:
- Android native coverage docs: https://android.googlesource.com/platform/build/soong/+/master/docs/native_code_coverage.md
- LLVM version matching: https://discourse.llvm.org/t/error-invalid-file-format-bad-magic-with-fprofile-instr-use/32852
- Profile format spec: https://leodido.dev/demystifying-profraw/
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>1 parent 5fd3751 commit 0121ab2
File tree
2 files changed
+34
-6
lines changed- .github
- actions/swift-android-action
- workflows
2 files changed
+34
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
602 | | - | |
603 | | - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
604 | 626 | | |
605 | 627 | | |
606 | 628 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
180 | 186 | | |
181 | 187 | | |
182 | 188 | | |
| |||
0 commit comments