http://qs321.pair.com?node_id=1158036

cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:

To debug an issue, I need to install an older DBI and DBD::Oracle.

I thought I'd done everything correctly (using PREFIX after the perl MakeFile.PL call, but when I try to run the app that is using the new libraries (using a BEGIN block to add the custom lib dirs), I get this error:

DBD::Oracle object version 1.74 does not match bootstrap parameter 1.64 at .../DynaLoader.pm line 223

Dumping @INC in DynaLoader, I see that the custom lib dirs aren't in it. A quick scan of similar reports on Google finds me an explanation of how to reinstall a single DBD::Oracle, but how do I fix this so that I can test my app with the old version of DBD::Oracle while leaving the current in place?

Edit: more info...

I installed v1.64 of DBD::Oracle from a tar.gz download from CPAN:

#> perl MakeFile.PL PREFIX=/path/to/local/lib #>make && make test

There were test errors. On closer examination, they appeared to just be miscounts of number of tests, so I installed the module:

make install

In looking in the local lib dir, I see that the DBD::Oracle code is there - both DBI.so and DBD/Oracle/Oracle.so

I wrote this test script:

#!/usr/bin/perl BEGIN { use lib '/path/to/local/lib/lib64/perl5'; } use strict; use warnings; use v5.010; use Data::Dumper 'Dumper'; use DBI; say Dumper(\@INC,\%INC); require DBD::Oracle;

(the use/require DBI/DBD are copied from the app I'm debugging. The output I got was:

$VAR1 = [ '/path/to/local/lib/perl5lib/lib64/perl5', '/usr/local/lib64/perl5', '/usr/local/share/perl5', '/usr/lib64/perl5/vendor_perl', '/usr/share/perl5/vendor_perl', '/usr/lib64/perl5', '/usr/share/perl5', '.' ]; $VAR2 = { 'warnings/register.pm' => '/usr/share/perl5/warnings/registe +r.pm', 'XSLoader.pm' => '/usr/lib64/perl5/XSLoader.pm', 'List/Util.pm' => '/usr/lib64/perl5/List/Util.pm', 'warnings.pm' => '/usr/share/perl5/warnings.pm', 'Config_git.pl' => '/usr/lib64/perl5/Config_git.pl', 'DBI.pm' => '/path/to/local/lib/perl5/DBI.pm', 'Config.pm' => '/usr/lib64/perl5/Config.pm', 'Carp.pm' => '/usr/share/perl5/Carp.pm', 'bytes.pm' => '/usr/share/perl5/bytes.pm', 'Scalar/Util.pm' => '/usr/lib64/perl5/Scalar/Util.pm', 'Exporter/Heavy.pm' => '/usr/share/perl5/Exporter/Heavy.pm', 'strict.pm' => '/usr/share/perl5/strict.pm', 'Exporter.pm' => '/usr/share/perl5/Exporter.pm', 'vars.pm' => '/usr/share/perl5/vars.pm', 'constant.pm' => '/usr/share/perl5/constant.pm', 'Config_heavy.pl' => '/usr/lib64/perl5/Config_heavy.pl', 'overload.pm' => '/usr/share/perl5/overload.pm', 'AutoLoader.pm' => '/usr/share/perl5/AutoLoader.pm', 'lib.pm' => '/usr/lib64/perl5/lib.pm', 'DynaLoader.pm' => '/usr/lib64/perl5/DynaLoader.pm', 'Data/Dumper.pm' => '/usr/lib64/perl5/Data/Dumper.pm', 'feature.pm' => '/usr/share/perl5/feature.pm' }; DBD::Oracle object version 1.74 does not match bootstrap parameter 1.6 +4 at /usr/lib64/perl5/DynaLoader.pm line 223. Compilation failed in require at tmp.pl line 14.

So, that use lib statement doesn't appear to be being honored by DynaLoader.

Edit 2:

I tried INSTALL_BASE instead of PREFIX and it appears to have worked! Anyone know a deep reason why that should be? The MakeMaker docs don't appear to clarify.

Replies are listed 'Best First'.
Re: Trouble getting a local DBD::Oracle to work (Dynaloader!)
by syphilis (Archbishop) on Mar 17, 2016 at 03:28 UTC
    DBD::Oracle object version 1.74 does not match bootstrap parameter 1.64 at .../DynaLoader.pm line 223

    That's usually a sign of a botched install.
    The version of your Oracle.pm is 1.64, and it wants to wants to bootstrap object version 1.64 (where "object version" is the version of the Oracle shared object that perl builds and installs as part of the DBD::Oracle build and installation process).
    However, the object that it finds is still version 1.74.

    So ... it seems you've successfully downgraded Oracle.pm from 1.74 back to 1.64, but the compiled/XS element of DBD::Oracle that's being found is version 1.74.
    Either you failed to properly build and install DBD-Oracle-1.64, or the "object" for 1.64 has, instead of overwriting the "object" for 1.74, been installed into a different location - one that occurs later in @INC.

    Are you sure you built and installed DBD::Oracle correctly ? (Replacing version 1.74 of Oracle.pm with version 1.64 of Oracle.pm is not sufficient.)

    Cheers,
    Rob
      I've added more info to the original post.
Re: Trouble getting a local DBD::Oracle to work (Dynaloader!)
by beech (Parson) on Mar 17, 2016 at 02:42 UTC
Re: Trouble getting a local DBD::Oracle to work (Dynaloader!)
by syphilis (Archbishop) on Mar 17, 2016 at 22:48 UTC
    I tried INSTALL_BASE instead of PREFIX and it appears to have worked! Anyone know a deep reason why that should be?

    I've not used PREFIX and I don't know exactly what it does, but it apparently does something a bit differently to INSTALL_BASE (which I *have* used).

    Presumably PREFIX didn't put the Oracle.so in the appropriate place and the Oracle.so (version 1.74), which still exists elsewhere in the @INC search paths, was the first Oracle.so that was found.

    Cheers,
    Rob