[cfe-dev] Absolute paths in code coverage info

Vedant Kumar via cfe-dev cfe-dev at lists.llvm.org
Tue Jun 2 10:43:58 PDT 2020


A problem that absolute paths solve in local builds is dealing with a changing compilation directory - this can result in two different files being referenced by the same relative path.

There was a promising attempt to make this work with remote builds. The idea was to have the coverage mapping logic respect a fixed compilation directory option (https://reviews.llvm.org/D68733 <https://reviews.llvm.org/D68733>), i.e. the paths embedded in the coverage mapping should be rooted at the -fdebug-compilation-dir <path>. It looks like the patch was reverted, but (as far as I know) there aren’t any fundamental issues with it.

> On Jun 2, 2020, at 9:57 AM, Keith Smiley via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> Hey everyone,
> 
> Currently when generating code coverage by passing `-fprofile-instr-generate -fcoverage-mapping` to clang, the __LLVM_COV / __llvm_covmap section ends up containing absolute paths to the source files being compiled. This causes issues when producing coverage info with remote builds where the absolute paths to the source files may differ between machines.
> 
> llvm-cov has a `-path-equivalence` flag in order for you to remap a single absolute path from the coverage info which definitely helps, but it doesn't solve this entirely for the cases where you have multiple paths that need remapping, or you're using another tool such as, Xcode's code coverage UI, that doesn't support this kind of path remapping.
> 
> I'm wondering if it has been discussed, or how feasible it would be, for me to remove the necessity for absolute paths in this info.
> 
> Thanks!
> --
> Keith Smiley
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200602/85adce07/attachment-0001.html>


More information about the cfe-dev mailing list