cargo-llvm-cov: llvm-cov report - no filenames specified (failed only on windows and works on linux)

I’ve been trying to add coverage for the Rust part of a combined Python and Rust project. I’ve got it working for our linux CI builds, but trying the same thing for Windows is leading to this error:

Run cargo llvm-cov report --manifest-path=rust\Cargo.toml --codecov --output-path codecov.json -vvv
  
     Running `C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\llvm-profdata.exe merge -sparse -f D:\a\kolo\kolo\python\rust\target\rust-profraw-list -o D:\a\kolo\kolo\python\rust\target\rust.profdata`
     Running `C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\llvm-cov.exe export -format=text -use-color=0 -instr-profile=D:\a\kolo\kolo\python\rust\target\rust.profdata -ignore-filename-regex \\rustc\\[0-9a-f]+\\|^D:\\a\\kolo\\kolo\\python\\rust(\\.*)?\\(tests|examples|benches)\\|^D:\\a\\kolo\\kolo\\python\\rust\\target($|\\)|^C:\\Users\\runneradmin\\\.cargo\\(registry|git)\\|^C:\\Users\\runneradmin\\\.rustup\\toolchains($|\\)`
error: failed to generate report: process didn't exit successfully: `C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\bin\llvm-cov.exe export -format=text -use-color=0 -instr-profile=D:\a\kolo\kolo\python\rust\target\rust.profdata -ignore-filename-regex \\rustc\\[0-9a-f]+\\|^D:\\a\\kolo\\kolo\\python\\rust(\\.*)?\\(tests|examples|benches)\\|^D:\\a\\kolo\\kolo\\python\\rust\\target($|\\)|^C:\\Users\\runneradmin\\\.cargo\\(registry|git)\\|^C:\\Users\\runneradmin\\\.rustup\\toolchains($|\\)` (exit code: 1)
--- stderr
No filenames specified!

I have confirmed that the .profraw files are generated and are in the directory I expect them in:

Run dir rust\target
  

    Directory: D:\a\kolo\kolo\python\rust\target

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           8/11/2023 10:56 AM                debug
-a---           8/11/2023 10:55 AM           1048 .rustc_info.json
-a---           8/11/2023  9:00 AM            177 CACHEDIR.TAG
-a---           8/11/2023 10:56 AM        2377336 rust-1720-9197467843878644390_0.profraw
-a---           8/11/2023 10:57 AM        2377336 rust-3488-9197467843878644390_0.profraw
-a---           8/11/2023 10:57 AM        2377336 rust-4996-9197467843878644390_4.profraw
-a---           8/11/2023 10:57 AM        2377336 rust-5820-9197467843878644390_4.profraw
-a---           8/11/2023 10:57 AM        2377336 rust-5936-9197467843878644390_0.profraw

I’m at a loss how to further debug this.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 22 (16 by maintainers)

Most upvoted comments

Windows issue has been fixed in 0.5.30 (#307).

Also, diagnostics improvements (#302, #305, #306) have been released in 0.5.28 and 0.5.29.

I hid comments unrelated to this issue as off-topic.

And one of the reasons this issue has received unrelated additional reports is that the error itself is unclear. This is related to the fact that the error is handled on the llvm-tools side, and reporting the error with some hint on the cargo-llvm-cov side before passing arguments to llvm-tools should improve the situation (https://github.com/taiki-e/cargo-llvm-cov/issues/306).

As for the issue @LilyFoote has encountered (the original topic of this issue – I think that is cargo-llvm-cov or llvm-tools bug), I will fork your reproduction repo later and look into it. I’m guessing it is probably a windows path issue, but I’m still not sure what it really is.