Dependencies – how hard can it get?

Today I must have broke my own record in the number of new things installed in a day (actually just evening + night).

First I decided to abandon MS Money for GnuCash, which helped a lot with its double entry accounting, helping me to learn my accounts a little better.

Then comes the need for Exchange Rates. No fear, GnuCash works with Finance::Quote, a Perl module that can pull down live rates.

Having not written code for a while, my perl libraries were sorely lacking, but like all CPAN modules, it will find its own dependencies and pull them down. Amongst them HTML::Parser, LWP, Crypt-SSLeay, Date::Manip etc.

First the obvious complain was openssl was missing. Being lazy instead of building, I got the pre-built version from another provider who require me to get VC++ 2008 Redistributable. Not so big, I guess, let’s do it.

But everything is still broken.

Then it turns out that the script was calling nmake, Microsoft’s version of make. No problem let’s go get it. Now it limps along better, but something is still wrong, and it then it dawn upon me that Crypt-SSLeay and HTML::Parser needs cl – the Visual C/C++ compiler!

So the redistributable is useless, i need, essentially, Visual Studio. So I tried the express version, as it’s free. The blardy thing and all its dependency (even recommending SQL Server Express which I ignored for now) was 98MB … No problem, let’s do it.

After watching some Star Wars on TV, I now have cl.exe, link.exe etc goodness. Turns out that there’s a new environment setup batch file (C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat) to run in order for the command to execute correctly. Ah compiled happiness.

But all tests still failed.

The error was confusing: Can’t load ‘C:\Perl\cpan\build\HTML-Parser-3.59\blib\arch/auto/HTML/Parser/Parser.dll’ for module HTML::Parser: load_file:The specified module could not be found at C:/Perl/lib/DynaLoader.pm line 230.

It sounded like HTML::Parser wasn’t compiled properly. The DLL was there in the stated directory (and no it wasn’t the slash directions). After running around in circles, it was depends.exe that revealed that MSVCR90.dll was missing (which my spanking new Visual C++ 2008 compiler made Parser.dll depend on). This led to another mad hunt for the location of the file, which turns out to be in the totally new things to me at C:\Windows\WinSxS\…

WinSxS is Side-by-side! Similai… Another guy got similar problems, and more detailed explanation is found on MS’s feedback and MSDN. But it was this VMWare thread that succinctly said that it was due to the version of Visual Studio and the ActiveState Perl that I had installed sometime back, and there’s a magic file you can put in your perl dierctory that goes like this

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity version="5.8.0.802"
processorArchitecture="x86" name="+perl"
type="win32"/>
<description>ActivePerl</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
name="Microsoft.VC80.CRT"
version="8.0.50727.42"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"
language="*" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"
language="*" />
</dependentAssembly>
</dependency>
</assembly>

Name it perl.exe.manifest and you’re done. Now HTML::Parser is happy because Perl 5 found its VC90 DLL, runs all the tests nicely and Finance::Quote is happy being installed in to Perl directory, and finally GnuCash’s “Get Quote” button in the “Price Editor” is enabled for me to download the latest SGD::USD exchange rate in one click.

What a night.

Still want to install open source software? 😉

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to Top