mozilla / grcov

Rust tool to collect and aggregate code coverage data for multiple source files
Mozilla Public License 2.0
1.15k stars 148 forks source link

It seems that grcov can't work with cxx bridge #1175

Closed MochiXu closed 1 month ago

MochiXu commented 5 months ago

My rust project is a FFI library for cpp, it integrates with cxx library. When generate coverage report, errors happened.

❯ grcov . -s . --binary-path ./target/debug/ -t cobertura --branch --ignore-not-existing -o .                       
03:57:01 [ERROR] A panic occurred at /home/mochix/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/grcov-0.8.19/src/llvm_tools.rs:110: 
Failed to open directory '"./target/debug/"': File system loop found: ./target/debug/build/tantivy_search-125cdd8efd245d38/out/cxxbridge/crate/tantivy_search/build/cargo/build/x86_64-unknown-linux-gnu/relwithdebinfo/build/tantivy_search-eef39e5ef494680d/out/cxxbridge/crate/tantivy_search points to an ancestor ./target/debug/build/tantivy_search-125cdd8efd245d38/out/cxxbridge/crate/tantivy_search
MochiXu commented 5 months ago

This does nod work even with the ignore field added

❯ grcov . -s . --binary-path ./target/debug/ -t cobertura --branch --ignore "./target/debug/build/tantivy_search-125cdd8efd245d38/out/cxxbridge/" -o .          
04:48:52 [ERROR] A panic occurred at /home/mochix/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/grcov-0.8.19/src/llvm_tools.rs:110: 
Failed to open directory '"./target/debug/"': File system loop found: ./target/debug/build/tantivy_search-125cdd8efd245d38/out/cxxbridge/crate/tantivy_search/build/cargo/build/x86_64-unknown-linux-gnu/relwithdebinfo/build/tantivy_search-eef39e5ef494680d/out/cxxbridge/crate/tantivy_search points to an ancestor ./target/debug/build/tantivy_search-125cdd8efd245d38/out/cxxbridge/crate/tantivy_search