JuliaIO / GZip.jl

A Julia interface for gzip functions in zlib
https://juliaio.github.io/GZip.jl/dev
MIT License
39 stars 30 forks source link

Add Appveyor support - Windows testing #40

Closed hustf closed 1 year ago

hustf commented 8 years ago

As far as I can see, this must always fail? I am loath to try and solve this since I probably don't understand the original purpose.

If the code below fails (as it does on Windows at least), then some subsequent tests are not run - in the present master. But because of the try-catch statement, this may instead seem like a try at forcing test success? But that makes no sense?

runtests.jl:17
@windows_only gunzip="gunzip.exe"
@unix_only    gunzip="gunzip"
test_gunzip = true
 try
     run(`which $gunzip` |> DevNull)
 catch
     test_gunzip = false
 end

Out-of context test on Windows:

julia> run(pipeline(`which gunzip.exe`, DevNull))
ERROR: could not spawn `which gunzip.exe`: no such file or directory (ENOENT)
 in _jl_spawn at process.jl:262

A reasonable purpose here at the start might be to check if gunzip is present and and runnable on the system. But simply running it without command line arguments (like simply -h) would return an error:

julia> run(`gunzip.exe`)
(....)ERROR: failed process: Process(`gunzip.exe`, ProcessExited(1)) [1]
 in run at process.jl:531

Would this work on unix_only too?

@windows_only run(pipeline(`gunzip.exe -h`, DevNull))
@unix_only         run(pipeline(`gunzip.exe -h`, DevNull))
hustf commented 8 years ago

The travis.yml file excludes testing on Windows. It takes a while to discover these things.

Non-tested code here may affect, for example, users of packages Codecs WinRPM ZipFile ZLib Gadfly ZMQ Nettle HDF5 TestImages ...and the list goes on. This package really ought to work and be tested on Windows I think.

kmsquire commented 8 years ago

Hi @hustf, thanks for your interest in this package. Recently, LibZ.jl was released, which is meant to replace both GZip.jl and Zlib.jl. As that package gets more traction, it's likely that both of these latter packages will be deprecated. I encourage you to check out LibZ.jl and see if it fits your needs.

hustf commented 8 years ago

Oh, good, because this was getting pretty difficult: ccall(:dup, Int32, (Int32,) fd) on GZip.jl:278 gives could not load symbol "dup" on Windows, not on Mac.

I´ll make a pull request on what I have, though it´s a dead end.

hustf commented 8 years ago

That´s done. Pull request #41. The updated travis would make Windows tests fail.

kmsquire commented 8 years ago

@simonster made the comment in #41 that Windows isn't supported on Travis. A little googling suggests that Windows support is actually moving forward there, but until it becomes fully supported and common, the Julia community has settled on Appveyor as the Windows solution for testing.

So, @hustf, if you wanted, this issue could be retitled to add Appveyor support. (Notably, Libz.jl doesn't have Appveyor support either.)

hustf commented 8 years ago

Thanks for the patience, @simonster and @kmsquire. #41 shouldn't, of course, be pulled in as it is. In my repo, 16 out of 64 packages have Appveyor.yml so far.

The Compat package seems to be an exemplary template. Output here: https://ci.appveyor.com/project/quinnj/compat-jl/branch/master