PDK 9.1.1 perlapp oddities when including module Net::SSH2

Posted by therealdon on 2012-12-08 22:18
Forums: PDK discussion | OS: All / Any

Greetings,

Running...
Licensed PerlApp 9.1.1 build 295479
Community ActivePerl 5.14.2 x64
HostOS: osname=MSWin32, osvers=5.2, archname=MSWin32-x64-multi-thread (WIN7 64Bit)

So, I have hunted for a module to put in my app to automate SSH destined for multiple OS targets. My Targets are Win32/64 and linux and the module I chose is Net::SSH2. Sadly, I couldn't find any pre-built Net::SSH2 from the Activestate PPM repository as it reports all attempts to build failed? So I did what "ppm repo suggest" suggested and added another repository :>

I added sisyphusion and Net::SSH2 installed without a hassle using Activestate PPM. I then put together a quick script using the module and then wrapped for my native OS and all is well, the wrapped exe runs as expected.

I then changed my target to windows x86-32...
perlapp --norunlib --target windows-x86-32 --exe bootstrap.exe-windows-x86-32.exe bootstrap.pl

perlapp completes with -0- errors... however the wrapped exe when executed on the same Win7 host fails with the following...

Can't load 'auto/Net/SSH2/SSH2.dll' for module Net::SSH2: load_file:The specified module could not be found at /DynaLoade
r.pm line 221.
at perlapp line 848
BEGIN failed--compilation aborted at bootstrap.pl line 4.

Is this a Net::SSH2 build issue or a perlApp issue?
If Net::SSH2, whats the chances/timeframe of getting a build in Activestate PPM for 5.14?
If there is another feature equal SSH2 module on ActiveState PPM for 5.14 other than Net::SSH2 please point in that direction, I have searched for a clean perl SSH solution until my eyes bleed :)

Thanks.

therealdon | Mon, 2012-12-17 07:05

Can't believe I am the only one who is trying to utilize SSH on windows in an wrapped exe?
From my view there is no working standalone SSH module on ActiveState for windows?
Any help would be appreciated!

therealdon | Sat, 2013-07-06 13:43

Anyone?

christopher.taranto | Wed, 2017-01-04 11:40

Hi,

>> Can't load 'auto/Net/SSH2/SSH2.dll' for module Net::SSH2: load_file:The specified
>> module could not be found at /DynaLoade

This is a follow up to this issue. I have been able to work around this error as follows.

ActiveState does not provide a working Net::SSH2 PPM package. But the Sisyphusion PPM repository does:

http://www.sisyphusion.tk/

Add the repository to the ActiveState Perl:

ppm repo add http://www.sisyphusion.tk/ppm

You will also need to add the Net::SFTP::Foreign::Backend::Net_SSH2 module.

The difficult part is accounting for the various external DLLs that are created for the module and having PDK find them to load. To do this successfully, I created a local libs directory in the current directory and added "libs" to the Run Library option in PerlApp.

I added the following DLL files in this libs directory (local to the current directory where I am compiling):

Found in C:\Perl\site\bin
lib492pthread-1.dll
libgcc_sis__492.dll
libstdc_492.dll

Found in C:\Perl\site\lib\auto\Net\SSH2
SSH2.dll

I upload the exe and the local libs directory (and files) to the server. The executable is able to find the DLLs and connect to the SFTP server.

I hope this helps someone down the line!