Skip to content

code coverage is broken - details of the error #6857

@sylvestre

Description

@sylvestre

I am going to collect some finding of my work (@cakebaker probably has other).

  • -Zprofile has been removed from rustc - Remove support for -Zprofile (gcov-style coverage instrumentation) rust-lang/rust#131829
    we should use -Cinstrument-coverage instead

  • we have to switch to a different method described here readme: example uses -Zprofile which has been removed from Rust nightly mozilla/grcov#1240 (cc @marco-c)

  • we need to pass LLVM_PROFILE_FILE as a new env variable, which wasn't passed to some commands by ucmd()
    i fixed it in 0cd58c6
    it was leaving some coverage artifacts in the pwd which was breaking some tests like ls.
    LLVM_PROFILE_FILE: "${{ github.workspace }}/build/coverage-%p-%m.profraw"

  • because of the change of format, files have to be exported into a different directory to make sure they don't pollute the tests

  • the coverage files are HUGE
    56G /Users/runner/work/coreutils/coreutils/build/ on a mac
    it causes the linux machine to fails with
    System.IO.IOException: No space left on device : '/home/runner/runners/2.320.0/_diag/Worker_20241116-105056-utc.log'
    and doesn't show anything in the log

  • it takes 16 minutes for grcov to process everything - it was a few seconds before

  • During one of my numerous experiment, i got <LLVM Profile Warning: Unable to track new values: Running out of static counters. Consider using option -mllvm -vp-counters-per-site=<n> to allocate more value profile counters at compile time. despite passing -Clink-arg=-Wl,-mllvm -Clink-arg=-Wl,-vp-counters-per-site=6, still happened.

  • Using cargo llvm-cov show-env like in https://github.com/foundationdb-rs/foundationdb-rs/blob/c6623a84a7f35597eb7f68357a3c9cb91831501e/.github/workflows/coverage.yml fails the same way

My experimentations: #6850

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions