Subject: | File-Rsync 0.45 fails tests on Windows |
Date: | Sun, 19 Jul 2015 20:34:57 +0200 |
To: | bugs-File-Rsync [...] rt.cpan.org |
From: | Max Maischein <corion [...] corion.net> |
Hello,
many thanks for writing the module - the module fails its test suite on
Windows. This is partially due to a broken/misled check in test.pl, and
partially due to using IPC::Open3, which adds interactivity at the price
of not working on Windows.
The misled check tries to find a file "rsync" in the path. This
functionality is never used by the module and in fact is misleading the
test suite on Windows because there is no file "rsync" but only "rsync.exe".
The test suite should check whether the "rsync" command is available by
running a no-op command like
`rsync --version`
to check whether any program responds to "rsync". I've attached a patch
to the CPAN version of "test.pl" (0.45) which makes the test suite pass
the first step on Windows and Linux (Debian).
The test suite also relies on the existence of a "rm" command, which
does not exist on Windows. I've replaced its use with File::Path's
rmtree() command.
I've replaced all functionality provided by IPC::Open3 with
functionality from IPC::Run3. This means that the stdout / stderr
callbacks won't be called as rsync outputs the text but on the upside,
this removes lots of code and complexity from the module, doing the
IO::Select dance for reading from whatever filehandle just provides
information. On Windows, (process) filehandles don't work with
IO::Select, so eliminating this functionality makes the module work on
Windows as well as on Linux.
If you're not interested in removing the "live" functionality, a good
approach to make the module work on both kinds of environment would be
to have a subclass, File::Rsync::Win32, which inherits from File::Rsync
and replaces the ->exec() method with the one I wrote. If you're
interested in going that route, keeping the complexity and featureset of
the original while also enabling most of the functionality on Windows,
just say so and I'll rewrite the code to delegate to ::Win32 on Windows.
These patches are also published on github at
https://github.com/Corion/File-Rsync
Thanks for maintaining this module,
-max
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.