Skip to content

Commit 5fd3751

Browse files
leogdionclaude
andcommitted
docs: document Android coverage limitation
After extensive testing, Swift Android's profraw files cannot be processed by any available llvm-cov tool: - Host Swift nightly llvm-cov: "bad magic" error - Android NDK llvm-cov: LLVM version mismatch - Swift toolchain llvm-cov: "bad magic" error (already tried) This appears to be a fundamental incompatibility with Swift for Android's coverage instrumentation. The profraw format generated in the Android environment is unreadable by all available tools. Solution: - Continue collecting profraw files as artifacts - Skip Codecov upload for Android - Document as known limitation The profraw files are preserved in artifacts for future investigation when Swift Android tooling improves. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent d5aa0ca commit 5fd3751

File tree

2 files changed

+6
-32
lines changed

2 files changed

+6
-32
lines changed

.github/actions/swift-android-action/action.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -599,28 +599,8 @@ runs:
599599
echo " fi" >> ${SCRIPT_FILE}
600600
echo "done" >> ${SCRIPT_FILE}
601601
602-
# Convert profraw to LCOV using Swift toolchain's llvm-cov (same nightly version)
603-
echo "echo '==> Converting profraw to LCOV format...'" >> ${SCRIPT_FILE}
604-
echo "if [ -f '${COVERAGE_DIR}/default.profraw' ]; then" >> ${SCRIPT_FILE}
605-
echo " # Find the test binary" >> ${SCRIPT_FILE}
606-
echo " TEST_BINARY=\$(find \${SWIFT_SDK_TARGET}/debug -name '*.xctest' | head -n 1)" >> ${SCRIPT_FILE}
607-
echo " if [ -n \"\$TEST_BINARY\" ]; then" >> ${SCRIPT_FILE}
608-
echo " # Use Swift toolchain's llvm-cov (matches the Swift compiler that generated profraw)" >> ${SCRIPT_FILE}
609-
echo " SWIFT_LLVM_COV=\"\${SWIFT_INSTALLATION}/bin/llvm-cov\"" >> ${SCRIPT_FILE}
610-
echo " if [ -f \"\$SWIFT_LLVM_COV\" ]; then" >> ${SCRIPT_FILE}
611-
echo " \"\$SWIFT_LLVM_COV\" export -format=lcov -instr-profile='${COVERAGE_DIR}/default.profraw' \"\$TEST_BINARY\" > '${COVERAGE_DIR}/coverage.lcov' 2>&1 && {" >> ${SCRIPT_FILE}
612-
echo " echo \"Successfully converted profraw to LCOV\"" >> ${SCRIPT_FILE}
613-
echo " } || {" >> ${SCRIPT_FILE}
614-
echo " echo \"Warning: Failed to convert profraw to LCOV\"" >> ${SCRIPT_FILE}
615-
echo " echo \"Keeping profraw file for artifact upload\"" >> ${SCRIPT_FILE}
616-
echo " }" >> ${SCRIPT_FILE}
617-
echo " else" >> ${SCRIPT_FILE}
618-
echo " echo \"Warning: Swift llvm-cov not found at \$SWIFT_LLVM_COV\"" >> ${SCRIPT_FILE}
619-
echo " fi" >> ${SCRIPT_FILE}
620-
echo " else" >> ${SCRIPT_FILE}
621-
echo " echo \"Warning: Test binary not found\"" >> ${SCRIPT_FILE}
622-
echo " fi" >> ${SCRIPT_FILE}
623-
echo "fi" >> ${SCRIPT_FILE}
602+
echo "echo '==> NOTE: profraw files from Swift Android cannot be processed by llvm-cov'" >> ${SCRIPT_FILE}
603+
echo "echo '==> Files saved to artifacts for investigation'" >> ${SCRIPT_FILE}
624604
625605
# List retrieved files for verification
626606
echo "echo '==> Coverage files retrieved:'" >> ${SCRIPT_FILE}

.github/workflows/MistKit.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,10 @@ jobs:
173173
collect-coverage: true
174174
coverage-output-dir: .build/coverage-android
175175

176-
- name: Upload coverage to Codecov
177-
if: success() && hashFiles('coverage-android/coverage.lcov') != ''
178-
uses: codecov/codecov-action@v4
179-
with:
180-
fail_ci_if_error: false
181-
flags: android-api34-swift-nightly
182-
verbose: true
183-
token: ${{ secrets.CODECOV_TOKEN }}
184-
files: coverage-android/coverage.lcov
185-
# LCOV file generated by Android NDK's llvm-cov (matches Android clang version)
176+
# Note: Android coverage cannot be uploaded to Codecov due to Swift Android tooling limitations
177+
# The profraw files cannot be processed by any available llvm-cov (host, NDK, or Swift toolchain)
178+
# All attempts result in "bad magic" or "version mismatch" errors
179+
# Keeping profraw files as artifacts for future investigation
186180

187181
- name: Upload Android coverage files as artifact
188182
if: always()

0 commit comments

Comments
 (0)