LocalCoverage.jl icon indicating copy to clipboard operation
LocalCoverage.jl copied to clipboard

Windows compatibility

Open elenev opened this issue 5 years ago • 4 comments

If I understand it correctly, right now this package isn't compatible with Windows because there's no windows version of LCOV. And trying to run the genhtml Perl script runs into errors because of Windows paths.

Locally, I've gotten around this by installing LCOV in WSL. Then, it's two lines of code:

First, I replace the slashes in lcov.info: run(`bash -c "tr '\\\\' '/' < coverage/lcov.info > coverage/lcov.info.tmp && mv coverage/lcov.info.tmp coverage/lcov.info"`)

Next, I call genhtml: run(`bash -c "genhtml -t "Test" -o coverage coverage/lcov.info"`)

It's very much a hack, but if people think it's useful, maybe it's worth a PR? Or is there a much simpler solution I'm missing? I didn't want to change genhtml's Perl code...

elenev avatar Oct 09 '20 05:10 elenev

Sorry for the late response. I have essentially no ability to test on windows, I got the impression that @tpapp didn't either, so if you're a windows user and want this working you're going to be pretty much left to your own devices. In particular, I really don't know how appropriate your suggestion is, but I don't think I'd have any objections to it if I were a windows user (who probably needs WSL for a lot anyway).

As far as I'm concerned, any PR that claims to fix windows and does not break linux would be welcome! Of course, a PR that also includes successful windows tests in appveyor or travis would be really great.

ExpandingMan avatar Oct 21 '20 14:10 ExpandingMan

Yes, tests for Windows and/or WSL would be nice if anyone adds functionality for those.

tpapp avatar Oct 22 '20 08:10 tpapp

On windows, I'm getting:

ERROR: LoadError: IOError: stat("C:\\Users\\brand\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe"): permission denied (EACCES)
Stacktrace:
  [1] uv_error
    @ .\libuv.jl:97 [inlined]
  [2] stat(path::String)
    @ Base.Filesystem .\stat.jl:152
  [3] isfile
    @ .\stat.jl:456 [inlined]
  [4] which(program_name::String)
    @ Base.Sys .\sysinfo.jl:518
  [5] top-level scope
    @ C:\Users\brand\.julia\packages\LocalCoverage\CZlOI\src\LocalCoverage.jl:17

Probably just a matter of changing the permissions on the file but

bramtayl avatar Aug 16 '22 19:08 bramtayl

Any chance #42 works to solve this ? I developed that on a Windows machine...

BambOoxX avatar Jul 09 '23 21:07 BambOoxX