Skip Menu |

This queue is for tickets about the Net-SSH-Mechanize CPAN distribution.

Report information
The Basics
Id: 77013
Status: resolved
Priority: 0/
Queue: Net-SSH-Mechanize

People
Owner: Nobody in particular
Requestors: d.thomas [...] its.uq.edu.au
Cc:
AdminCc:

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



Subject: tests can fail because mock-ssh uses /usr/bin/perl
I've just tried installing Net-SSH-Mechanize-0.1.2 in my own build of perl-5.14.2 on RHEL5 root@kolanut# ./Build test t/00.load.t ................. ok t/01.pod.t .................. ok t/01.single-capture.t ....... error: "GetOptionsFromArray" is not exported by the Getopt::Long module Can't continue after import errors at /data/opt/uq.local/build/uq.is.perl.rhel5-5.14.2- 20120504.build/tarball-build/Net-SSH-Mechanize-0.1.2/t/bin/mock-ssh line 5 The tests pass if I change t/bin/mock-ssh to use /opt/bin/perl (a slightly older version of my 5.14.2 build) rather than Red Hat's default 5.8.8. Is there an easy way for mock-ssh to use the perl this module is being built for ? FYI while the tests now pass, I do see t/01.single-capture.t ....... 1/4 unexpected stderr from command: stderr output t/01.single-capture.t ....... ok t/01.single-sudo-capture.t .. 1/4 unexpected stderr from sudo command: stderr output t/01.single-sudo-capture.t .. ok t/02.multi-capture.t ........ 1/32 unexpected stderr from command: stderr output unexpected stderr from command: stderr output unexpected stderr from command: stderr output unexpected stderr from command: stderr output unexpected stderr from command: stderr output unexpected stderr from command: stderr output unexpected stderr from command: stderr output unexpected stderr from command: stderr output unexpected stderr from command: stderr output unexpected stderr from command: stderr output t/02.multi-capture.t ........ ok
Thanks for pointing this out. I'll look into a way to get your case working. In the mean time you might get by with a force-install, or temporarily symlink /usr/bin/perl to your local build. Also I notice the error is one I know has trivial work-around, in that emulating GetOptionsFromArray isn't that hard. I shall do that rather than bump the Perl version requirements. Shouldn't be long, I hope. Finally, this message in the test output: Show quoted text
> unexpected stderr from command: stderr output
...is a known issue, so I'll add a note about it in the docs (unless I think of a solution). I think it's harmless, although right now I can't remember why it happens, if I ever understood it fully. Cheers, N
Subject: Re: [rt.cpan.org #77013] tests can fail because mock-ssh uses /usr/bin/perl
Date: Sun, 6 May 2012 23:11:06 +0000
To: "<bug-Net-SSH-Mechanize [...] rt.cpan.org>" <bug-Net-SSH-Mechanize [...] rt.cpan.org>
From: Danny Thomas <d.thomas [...] its.uq.edu.au>
On 07/05/2012, at 8:21 AM, Nick Stokoe via RT wrote: Show quoted text
> Thanks for pointing this out. I'll look into a way to get your case > working. In the mean time you might get by with a force-install, or > temporarily symlink /usr/bin/perl to your local build.
I think that might impact other stuff using system perl. Anyway I'm sure I've seen test scripts actually use the perl they're being built against ($ENV{'perl'} ?) but a brief look didn't find any examples. Danny
On Sun May 06 19:11:19 2012, d.thomas@its.uq.edu.au wrote: Show quoted text
> I think that might impact other stuff using system perl.
Agreed, but I did say "temporarily". And force-installs of the module should be safe. Show quoted text
> Anyway I'm sure I've seen test scripts actually use the > perl they're being built against ($ENV{'perl'} ?) but > a brief look didn't find any examples.
Indeed, see the docs for $^X in perlvar for how to do this. I've drafted a belt-and-braces fix, which both attempts to do this, and avoids using GetOptionsFromArray. Seems to work for me, using my version of Perl, but I really have to go to bed now, so I'll defer testing it further until the next time I get a window to work on this. In the mean time, you can have a look here: https://github.com/wu-lee/Net-SSH-Mechanize/tree/rt77013 Assuming you have the deps installed you might be able to help me by checking it out and testing it works on your system using: /opt/perl/bin/prove t (From the base directory of the repo.) Note that I've switched to using Dist::Zilla for this particular distro, so the Git repo now lacks a Build.PL (because DZilla generates one for me). Which, it occurs to me, unfortunately means that you won't be able to generate a CPAN tarball very easily and thereby install it, unless you know how to install and drive Dist::Zilla (which isn't exactly lightweight).
Ok, sorry for the delay, a new version 0.1.3 is heading out to CPAN. I've tested this on a machine with /usr/bin/perl removed and a replacement in /opt/perl. Seems to build and test without a problem now. Closing the ticket as fixed, please reopen if this fix doesn't work for you.