Re: Detect which version of perl an XS module is linked against?
by rafl (Friar) on Jan 02, 2008 at 23:52 UTC
|
You can load the xs extension using dlopen (or whatever windows has to realize that functionality - glib has g_module_open which allows to specify if symbols should be resolved lazily or not, so there has to be a way to do that on win32) and tell it to resolve all symbols non-lazily. If that fails it's probably due to some removed library.
Also I wonder why those extensions are linked against libperl. I thought those are loaded from perl/libperl. At least on my unix system I couldn't find a single extension linked to libperl.
| [reply] |
|
|
| [reply] |
|
|
DynaLoader provides a dl_load_file function, which will probably do what I said above, except you don't need c or anything.
Also be sure to set the PERL_DL_NONLAZY environment variable to something true to force nonlazy binding.
| [reply] |
Re: Detect which version of perl an XS module is linked against?
by xdg (Monsignor) on Jan 03, 2008 at 00:52 UTC
|
Since this is a windows error, you need to determine which version of perl an XS module was linked against without loading it. Anyone have any ideas on how this might be accomplished?
MSVC (2005):
> dumpbin /dependents MD5.dll
[snip]
Image has the following dependencies:
perl510.dll
KERNEL32.dll
msvcrt.dll
[snip]
I saw a web page suggesting there may have been a "depends.exe" in some other version.
MinGW (e.g. Strawberry Perl) and assuming you have grep for brevity:
> objdump -x MD5.dll | grep "DLL Name"
DLL Name: perl510.dll
DLL Name: KERNEL32.dll
DLL Name: msvcrt.dll
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
| [reply] [d/l] [select] |
Re: Detect which version of perl an XS module is linked against?
by Joost (Canon) on Jan 03, 2008 at 00:19 UTC
|
On my linux machines all locally installed perl modules are installed in a path that includes the perl version, for instance:
$ locate Moose.pm
/usr/local/lib/perl5/site_perl/5.8.8/Moose.pm
/usr/local/lib/perl5/site_perl/5.8.8/Test/Moose.pm
If your windows install does not have the same feature, you're probably stuck with trying to load each one and seeing if it fails.
Update: maybe this link may help
| [reply] [d/l] |
Re: Detect which version of perl an XS module is linked against?
by BrowserUk (Patriarch) on Jan 03, 2008 at 03:10 UTC
|
You goofed. AS allows you to upgrade minor versions (eg. 5.8.6 to 5.8.8) without throwing away everything you previously installed as this will, mostly, work.
But attempting to upgrade a major version (5.8.x to 5.10.x) and retain previously installed modules almost certainly won't. There are substantial internal changes (see the section "Changed Internals" of the 510 delta) that mean 5.8.x code will not coexist with 5.10.
Your best course of action would be to delete your entire perl directory tree (which you should have done in the first place) and install 5.10 again.
Your other alternative would have been to select a different path at install time (assuming you used the msi), or relocate to a different path if you used the zipped install.
Note: This is not a bug in AS Perl, it is how it is designed to work. If you attempted to load an xs module compiled under 5.8.8 using 5.10 under linux, you'd run into exactly the same problem.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
|
|
BrowserUk,
But attempting to upgrade a major version (5.8.x to 5.10.x) and retain previously installed modules almost certainly won't. ...
Your best course of action would be to delete your entire perl directory tree (which you should have done in the first place) and install 5.10 again.
Note: This is not a bug in AS Perl, it is how it is designed to work.
Perhaps you missed the part where I said I de-installed AS Perl 5.8.8 before installing AS Perl 5.10.0? In fact, AS Perl 5.10.0 won't let you install when it detects a previous version. Granted, I probably should have confirmed the perl directory was wiped but if AS refused to install prior to the de-install and happily agreed after, how was I to know it did not do its job correctly?
| [reply] |
|
|
Perhaps you missed the part where I said I de-installed AS Perl 5.8.8 before installing AS Perl 5.10.0?
No. I saw that.
In fact, AS Perl 5.10.0 won't let you install when it detects a previous version.
Really. That's strange because I have 5.8.6(AS811), 5.8.8(AS817) and 5.10 Beta all installed concurrently?
Granted, I probably should have confirmed the perl directory was wiped but if AS refused to install prior to the de-install and happily agreed after, how was I to know it did not do its job correctly?
I think it is optimistic to expect that an uninstall will remove stuff added to the install directories after the initial install. And if it did, it would prevent my being able to install a minor version upgrade over an existing install and so retain all the packages I already installed.
Indeed, I think it would be disasterous for it to try and work out what you might have installed using CPAN, CPANPLUS, PPM, and all the various manual install mechanisms. I also keep a lot of Perl related stuff, additional docs, various home generated scripts and modules, and the perl sources within the overall Perl directory tree. What should it do with those?
There are times when I prefer software to allow me to decide what I want to do.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
|
|
|
|
Re: Detect which version of perl an XS module is linked against?
by chromatic (Archbishop) on Jan 03, 2008 at 02:15 UTC
|
I fixed my problem by removing the offending module but I want to fix this for everyone.
That sounds like an ActiveState bug to me. I'm not sure how far to go to try to work around potentially broken Perl installations. (I'm not saying that you broke your Perl installation, only that AS Perl should be more careful.)
| [reply] |
|
|
| [reply] |