Repository: taiki-e/cargo-llvm-cov

Issue #265: Any plans to make this work with `--archive-file` ?
Created: 2023-04-25T19:48:25Z
Currently I am getting
Command exited with code 1:
error: the argument '--archive-file <PATH>' cannot be used with:
  --lib
  --bin <BIN>
  --bins
  --example <EXAMPLE>
  --examples
  --test <TEST>
  --tests
  --bench <BENCH>
  --benches
  --all-targets
  --package <PACKAGES>
  --workspace
  --exclude <EXCLUDE>
  --all
  --release
  --cargo-profile <NAME>
  --build-jobs <JOBS>
  --features <FEATURES>
  --all-features
  --no-default-features
  --target <TRIPLE>
  --target-dir <DIR>
  --ignore-rust-version
  --unit-graph
  --future-incompat-report
  --frozen
  --locked
  --offline
  -Z <FLAG>

Running
cargo llvm-cov --lcov --output-path lcov_integration.info nextest -P ci -j 32 --archive-file nextest-archive.tar.zst

Duplicate issue #300: llvm-cov report - no filenames specified (failed only on windows and works on linux)
Created: 2023-08-11T11:04:17Z
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.

Closing comment (2023-08-22T14:31:11Z): I hid comments unrelated to this issue as off-topic.

The issue @messense has encountered is misuse due to lack of clarity in the documentation or lack of warnings. The situation here will be improved by adding warnings for such cases. See (and subscribe) #302 and #305 if you are interested in the status of adding warnings.
The issue @detly has encountered is the lack of nextest archive support. This is tracked in #265. The PR supporting it (#266) is stalled, but the implementation itself should work (with my patch), so if there is no response from the PR author, I may add a commit to that PR and merge it. See (and subscribe) these issue and PR if you are interested in the status of supporting it.

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 (#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.