@@ -222,6 +222,28 @@ jobs:
222222 coverage combine -a --data-file='.coverage' || true
223223 mkdir -p report-output
224224 coverage xml -o ./report-output/coverage-${{ join(matrix.*, '-') }}.xml
225+ # Drop corrupt .profraw files (e.g. from killed/SIGTERM'd workers) before
226+ # running `cargo llvm-cov report`, otherwise `llvm-profdata merge` aborts the
227+ # whole job with: "invalid instrumentation profile data (file header is corrupt)
228+ # error: no profile can be merged".
229+ # We probe each .profraw with `llvm-profdata show` and remove the unreadable ones.
230+ LLVM_PROFDATA="$(rustc --print target-libdir)/../bin/llvm-profdata"
231+ if [ ! -x "$LLVM_PROFDATA" ]; then
232+ LLVM_PROFDATA="$(command -v llvm-profdata || true)"
233+ fi
234+ if [ -n "$LLVM_PROFDATA" ] && [ -x "$LLVM_PROFDATA" ]; then
235+ removed=0
236+ while IFS= read -r -d '' f; do
237+ if ! "$LLVM_PROFDATA" show "$f" >/dev/null 2>&1; then
238+ echo "Removing corrupt profraw: $f"
239+ rm -f "$f"
240+ removed=$((removed+1))
241+ fi
242+ done < <(find ./target -maxdepth 2 -name 'daft-coverage-*.profraw' -print0)
243+ echo "Removed $removed corrupt profraw file(s)."
244+ else
245+ echo "llvm-profdata not found; skipping corrupt profraw filtering."
246+ fi
225247 cargo llvm-cov report --lcov --output-path report-output/rust-coverage-${{ join(matrix.*, '-') }}.lcov
226248 env :
227249 # output of `cargo llvm-cov show-env --export-prefix`
@@ -327,7 +349,8 @@ jobs:
327349 uv venv --seed .venv
328350 echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
329351 source .venv/bin/activate
330- uv pip install -U twine toml maturin
352+ # Pin maturin <1.14: 1.14 rejects `--timings=html` (used in the Build wheels step below).
353+ uv pip install -U twine toml 'maturin<1.14'
331354 - uses : moonrepo/setup-rust@v1
332355 with :
333356 cache : false
0 commit comments