Skip Menu |

This queue is for tickets about the Filter-Crypto CPAN distribution.

Report information
The Basics
Id: 29795
Status: resolved
Priority: 0/
Queue: Filter-Crypto

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.20
Fixed in: (no value)



Subject: [PATCH] Incorrect extension for Win32
Patch for Module::Install::PRIVATE::Filter::Crypto You need to add '.exe' on Win32. -- Alexandr Ciornii, http://chorny.net
Subject: Crypto.pm.patch
--- Crypto.pm.dist Fri Jul 6 23:27:20 2007 +++ Crypto.pm Fri Oct 5 16:34:26 2007 @@ -227,8 +227,10 @@ # prefix directory as specified in the latest OpenSSL's own INSTALL # file if it exists. my $bin_file; - if ($bin_file = $self->can_run('openssl') or - $bin_file = $self->can_run('ssleay')) + my $exe_ext=''; + $exe_ext='.exe' if $self->is_win32(); + if ($bin_file = $self->can_run('openssl'.$exe_ext) or + $bin_file = $self->can_run('ssleay'.$exe_ext)) { if ($self->is_win32()) { # Find out (if we can) which platform this binary was built for. @@ -243,7 +245,7 @@ if ($bin_rc) { $self->exit_with_error(133, "Could not get OpenSSL/SSLeay version information " . - "(%d):\n%s", $bin_rc, $bin_output + "(%d):\ncommand:%s\n%s", $bin_rc, $bin_cmd, $bin_output ); }
What OS are you running this on? The code works fine as-is on my Windows XP system (assuming I have an openssl.exe somewhere in my PATH). The can_run() call ends up in ExtUtils/MM_Win32.pm's maybe_command() function, which tries out various extensions if the command being tested doesn't already have one.
On Oct 05 13:10:13 2007, SHAY wrote: Show quoted text
> What OS are you running this on?
Windows XP. I don't have openssl.exe in my PATH, but I have c:\openssl directory and my PATH ends on ';'. It means that in can_run() it searchs for openssl in catfile('','openssl')='\openssl'. -x returns 1 for perl -e "print -x '\openssl'" if on c: and false on other drives. IMHO it is problem of Module::Install. Latest version has same code, so upgrading would not help.. -- Alexandr Ciornii, http://chorny.net
On Fri Oct 05 14:55:15 2007, CHORNY wrote: Show quoted text
> On Oct 05 13:10:13 2007, SHAY wrote: >
> > What OS are you running this on?
> Windows XP. I don't have openssl.exe in my PATH, but I have c:\openssl > directory and my PATH ends on ';'. It means that in can_run() it searchs > for openssl in catfile('','openssl')='\openssl'. -x returns 1 for perl > -e "print -x '\openssl'" if on c: and false on other drives. > > IMHO it is problem of Module::Install. Latest version has same code, so > upgrading would not help.. >
I agree that it is mostly a problem with Module::Install, but your PATH is unusual and I still don't see the behaviour that you do even if my PATH ends with ';' too. The can_run() method does a split(/$Config::Config{path_sep}/, $ENV{PATH}), which does not produce a null string item in the list even if $ENV{PATH} does end with the $Config::Config{path_sep} character because split() deletes empty trailing fields. For example, if I have: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\perl5\bin; then the paths tested are: C:\WINDOWS\system32\openssl C:\WINDOWS\openssl C:\perl5\bin\openssl (plus .\openssl because '.' is checked as well as the directories in PATH) I only get the false-positive result if my PATH begins with ';', e.g.: PATH=;C:\WINDOWS\system32;C:\WINDOWS;C:\perl5\bin results in: \openssl C:\WINDOWS\system32\openssl C:\WINDOWS\openssl C:\perl5\bin\openssl (plus .\openssl again) So does your PATH actually begin with ';' as well? In any case, I think the proper solution would be a fix for Module-Install (to skip null strings in the list returned from splitting the PATH). Simply adding '.exe' to 'openssl' on Win32 would still leave the same problem present on other systems, e.g. on Cygwin: perl -e 'print -x "/openssl"' also prints 1 if there is a /openssl directory.
On Tue Oct 09 08:44:56 2007, SHAY wrote: Show quoted text
> On Fri Oct 05 14:55:15 2007, CHORNY wrote:
> > IMHO it is problem of Module::Install. Latest version has same code, so > > upgrading would not help.. > >
> > I agree that it is mostly a problem with Module::Install,
I've now logged a bug against Module-Install for this: http://rt.cpan.org/Ticket/Display.html?id=29866.
Should be fixed in 1.22, which includes an upgrade to Module-Install-0.77 (which contains a fix for #29866).