julia
c0d34aa7 - Call `realpath` before comparing coverage paths (#60088)

Commit
37 days ago
Call `realpath` before comparing coverage paths (#60088) This commit fixes an issue where `--code-coverage=@path` does not work if `path` has any symlinks in it (which happens e.g. when testing `Pkg` in tree - ref #60058). The issue is that we call `realpath` on the cli argument, but do not currently call realpath when inserting the instrumentation. One fix would be to stop calling realpath on the cli argument, but that has the potential to break users who rely on this behavior. The other fix (implemented here) is to also call realpath when doing the comparison. However, this is a bit aweful, because, as currently structured, this requires us to do a file system query for every line table entry. Most of those line table entries will probably have the same file, so that's a lot of redundant (and depending on filesystem, potentially expensive work). That said, I think this is the best solution for the time being. At some point in the near future we need to completely overhaul all and move the filtering to the writer side (rather than during codegen), as well as making coverage cacheable and work in the interpreter. Until then, this at least helps with addressing the test failure.
Author
Parents
Loading