"please upgrade at Win32API/File.pm line 26"

Started by Marsu42, April 19, 2015, 10:58:43 AM

Previous topic - Next topic

Marsu42

Yo Mr. programmer sir, probably nothing to lose sleep over - but the win32 static exe (including all pearly stuff) shows an error message "Cannot load outdated Math::BigInt::FastCalc vunknown, please upgrade at Win32API/File.pm line 26". Kindly do so, users get irritated by cryptic error messages :->

Phil Harvey

Darn.  That's the first time I've seen this one.  I didn't even know that Win32API::File relied on Math::BigInt.

What command were you executing when you got this message?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Marsu42

Quote from: Phil Harvey on April 19, 2015, 01:08:21 PM
What command were you executing when you got this message?

I was using "exiftool.exe" :-p, no command necessary.

I usually run exiftool directly via x64 perl, so I only stumbled across it by mistake when I needed the single-exe distibution for a plugin. I faintly remember this error being there for several releases... but seeing you didn't fix it in the meantime, I reported it now. I hope it's not a bugus bug report, it's not like I tested it in a clean vm or something.

Phil Harvey

I have a feeling that the problem may be due to an old version of the Perl libraries installed somewhere on your system.  I certainly don't get the error on my test Windows system when I just run "exiftool.exe".  So I think the solution may be out of my control.  Maybe you could look for versions of Math::BigInt::FastCalc on your system and try upgrading them.  In the meantime I'll take a look at the exiftool.exe bundle and see what it contains.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Marsu42

Quote from: Phil Harvey on April 19, 2015, 09:14:19 PM
I have a feeling that the problem may be due to an old version of the Perl libraries installed somewhere on your system.  I certainly don't get the error on my test Windows system when I just run "exiftool.exe".  So I think the solution may be out of my control.

I thought of that possibility but immediately dismissed it as the unpacked win32-exiftool should really only look in its own subdirs for libs, at least in a first step?

Otherwise I could very well have an old library somewhere as I'm using cygwin for example. When I'm running the current exiftool perl distro with a local x64 perl everything's fine though. And in the outdated lib from the error message doesn't seem to break anything.

Phil Harvey

OK, I've finally dragged out the PC to take a look at this.

Math::BigInt::FastCalc is not included in the ExifTool Windows EXE bundle.  Apparently it is an optional library used by Math::BigInt if available.  And it seems that you have an older version of it on your system.  Your problem should be solved if you update this (you may also have to update its dependencies).  Or you could just delete it.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Marsu42

Quote from: Phil Harvey on April 21, 2015, 07:12:53 AM
OK, I've finally dragged out the PC to take a look at this

Right, I'll do that, thanks!

Having said that, I'd find deleting this dependency altogether from the bundled exiftool.exe preferable (by modifying Math::BigInt) as imho all libs should be included and non other pulled from outside the unpacked dir. If it starts pulling weird libs from all over the place, who knows what will happen, and in any case errors like this only generate unnecessary bug threads (like this :-p).

Phil Harvey

I considered that, but I don't think it is my place to modify Math::BigInt, even inside an ExifTool bundle.  For sure, down the road, I would update Math::BigInt for whatever reason and forget to re-do my patch, so it would be a temporary patch anyway.

The better solution would probably be to include the proper version of Math::BigInt::FastCalc, but it has additional dependencies that caused me to have second thoughts about this too.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Marsu42

Quote from: Phil Harvey on April 21, 2015, 12:50:47 PM
I considered that, but I don't think it is my place to modify Math::BigInt, even inside an ExifTool bundle.

Well, last 2ct from me: It's open source for a reason. The chances of someone grabbing a modified Math::BigInt from the temp directory are about nil, but to make sure you could just rename the lib-name, lib-dir and lib-pm to "Math::BigInt_tiny_mod_by_Phil_Harvey_for_exiftool_win32_exe_dist".

But: another "proper" option would be to modify the include paths (either with some local perl config or when perl calls the embedded exiftool) - shouldn't it be possible to prevent the unpacked perl pulling an outdated Math::BigInt::FastCalc from elsewhere? Just a thought, obviously the outdated lib doesn't cause any problems in this case.

Phil Harvey

Sounds like work for me. :P

But seriously, if this ever happens again then I will seek a solution.  But I'm thinking that it may not.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).