Subject: | Testing PREFER_BIN and Windows |
Date: | Thu, 29 Nov 2012 16:38:27 +0000 |
To: | bug-archive-extract [...] rt.cpan.org |
From: | Smylers <Smylers [...] stripey.com> |
The Archive::Extract docs recommend setting $PREFER_BIN for large files,
but this behaviour is untested on Windows since 4553a37, which skips
errors on windows when using binary tools.
There are several related issues here:
* On most Windows systems, which don't have the binary tools, using
$PREFER_BIN should be safe, since it should fall through to using Perl
modules.
* The tests don't actually check that. Perl-only and binary-only are
tested in turn, but not having both being allowed at once or having
one falling through to t'other.
Even if it isn't useful to test using binary tools on Windows it
should still be possible to test that trying to use non-existent
binary tools correctly falls through to using Perl, for example so we
can add in a test to prevent this bug re-occurring:
https://github.com/jib/archive-extract/pull/2
* If binary tools shouldn't be used on Windows, it's unfortunate that
the docs recommend setting $PREFER_BIN in some circumstances.
It'd be useful to have a setting which means 'prefer binary tools if
we're on a platform where that's sensible'.
Perhaps $PREFER_BIN = 1 could just be changed to mean that? (As in,
ignore it on Windows -- after all, it's only a preference.) A second
variable, $INSIST_ON_BIN, could be created to insist on using the
binary tools on all platforms.
That would automatically fix existing code which is using $PREFER_BIN
to do the right thing on Windows.
Or, if tweaking the meaning of $PREFER_BIN = 1 is unacceptable, maybe
another value, such as $PREFER_BIN = 'platform' could be introduced to
mean 'do the most appropriate thing for the current platform'. That
would then require evangelizing to people currently using $PREFER_BIN
= 1.
Any thoughts?
Cheers
Smylers
--
I get called "evil" by Victoria Coren in this week's 'Only Connect'.
Watch online: http://www.bbc.co.uk/programmes/b01p2mrh