Subject: | [PATCH] Doesn't build (with Instant Client) when ORACLE_HOME is a symbolic link |
Just passing *all* the information, hoping that might better explain
the problem ...
$ cpan DBD::Oracle
:
:
CPAN: File::Temp loaded ok (v0.22)
CPAN: Parse::CPAN::Meta loaded ok (v1.4401)
CPAN: CPAN::Meta loaded ok (v2.112150)
CPAN: Module::CoreList loaded ok (v2.55)
CPAN.pm: Building P/PY/PYTHIAN/DBD-Oracle-1.30.tar.gz
Using DBI 1.616 (for perl 5.014001 on i686-linux-64int-ld) installed
in /pro/lib/perl5/site_perl/5.14.1/i686-linux-64int-ld/auto/DBI/
Configuring DBD::Oracle for perl 5.014001 on linux (i686-linux-64int-ld)
Remember to actually *READ* the README file! Especially if you have any
problems.
Installing on a linux, Ver#2.6
Using Oracle in /pro/oracle/v11.2
DEFINE _SQLPLUS_RELEASE = "1102000200" (CHAR)
Oracle version 11.2.0.2 (11.2)
Unable to locate an oracle.mk or other suitable *.mk
file in your Oracle installation. (I looked in
/pro/oracle/v11.2/rdbms/demo/demo_xe.mk /pro/oracle/v11.2/rdbms/
demo/demo_rdbms32.mk under /pro/oracle/v11.2)
The oracle.mk (or demo_rdbms.mk) file is part of the Oracle
RDBMS product. You need to build DBD::Oracle on a
system which has one of these Oracle components installed.
(Other *.mk files such as the env_*.mk files will not work.)
Alternatively you can use Oracle Instant Client.
In the unlikely event that a suitable *.mk file is installed
somewhere non-standard you can specify where it is using the -m
option:
perl Makefile.PL -m /path/to/your.mk
See the appropriate README file for your OS for more
information and some alternatives.
at Makefile.PL line 1111.
Warning: No success on command[/pro/bin/perl Makefile.PL]
PYTHIAN/DBD-Oracle-1.30.tar.gz
/pro/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to
determine prerequisites
$ perl -MV=DBD::Oracle
DBD::Oracle
/pro/lib/perl5/site_perl/5.14.1/i686-linux-64int-ld/DBD/
Oracle.pm: 1.28
$ rpm -qa | grep -i oracle
oracle-instantclient11.2-tools-11.2.0.2.0-1.i386
oracle-instantclient11.2-basic-11.2.0.2.0-1.i386
oracle-instantclient11.2-jdbc-11.2.0.2.0-1.i386
mono-data-oracle-2.8.2-0.2.3.i586
oracle-instantclient11.2-devel-11.2.0.2.0-1.i386
oracle-instantclient11.2-odbc-11.2.0.2.0-1.i386
oracle-instantclient11.2-precomp-11.2.0.2.0-1.i386
oracle-instantclient11.2-sqlplus-11.2.0.2.0-1.i386
$ ls -l /pro/oracle
total 0
lrwxrwxrwx 1 merijn users 27 Sep 6 2010 v11 -> /usr/lib/oracle/11.2/
client
lrwxrwxrwx 1 merijn users 3 Sep 15 2010 v11.2 -> v11
$ ls -l v11/
total 8
lrwxrwxrwx 1 root root 13 Sep 7 14:14 admin -> network/admin
drwxr-xr-x 2 root root 4096 Sep 7 13:58 bin
drwxr-xr-x 3 root root 4096 Sep 7 13:58 lib
lrwxrwxrwx 1 root root 10 Sep 7 14:13 network -> ../network
$ echo $LD_LIBRARY_PATH/
/pro/oracle/v11.2/lib/
$ echo $ORACLE_HOME
/pro/oracle/v11.2
Even when I unset $ORACLE_HOME, Makefile.PL is friendly enough to put
it back to what it was:
Trying to find an ORACLE_HOME
Your LD_LIBRARY_PATH env var is set to '/pro/oracle/v11.2/lib'
Found /pro/oracle/v11.2
WARNING: Setting ORACLE_HOME env var to /pro/oracle/v11.2 for you.
WARNING: If these tests fail you may have to set ORACLE_HOME yourself!
Installing on a linux, Ver#2.6
Using Oracle in /pro/oracle/v11.2
DEFINE _SQLPLUS_RELEASE = "1102000200" (CHAR)
Oracle version 11.2.0.2 (11.2)
If I set $ORACLE_HOME to the *real* path, build passes, hence the
working fix (also attached):
--8<---
--- a/Makefile.PL 2011-08-26 17:25:36.000000000 +0200
+++ b/Makefile.PL 2011-09-07 15:03:07.691000109 +0200
+0200
@@ -135,7 +135,7 @@ Remember to actually *READ* the README f
my $ORACLE_ENV = ($os eq 'VMS') ? 'ORA_ROOT' : 'ORACLE_HOME';
my $OH = $ENV{$ORACLE_ENV} || '';
-$OH = win32_oracle_home($OH) if ($os eq 'MSWin32') or ($os =~ /cygwin/
i);
+$OH = win32_oracle_home($OH) if ($os eq 'MSWin32') or ($os =~ /cygwin/
i);
$OH = unixify $OH if $os eq 'VMS';
$OH =~ s:/$::;
@@ -153,6 +153,7 @@ if (!$OH) {
print "WARNING: If these tests fail you may have to set ORACLE_HOME
yourself!\n";
sleep 5;
}
+-l $OH and $OH = Cwd::abs_path ($OH); # Oracle really dislikes
symbolic links
die qq{ The $ORACLE_ENV environment variable value ($OH) is not valid.
It must be set to hold the path to an Oracle installation directory
-->8---
After that, almost all tests pass \o/
It might be important to know that my database is 11.2/US7ASCII:
t/58object.t ............ 1/65
t/58object.t ............ Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/65 subtests
Subject: | Makefile.PL.diff |
--- a/Makefile.PL 2011-08-26 17:25:36.000000000 +0200
+++ b/Makefile.PL 2011-09-07 15:03:07.691000109 +0200
@@ -135,7 +135,7 @@ Remember to actually *READ* the README f
my $ORACLE_ENV = ($os eq 'VMS') ? 'ORA_ROOT' : 'ORACLE_HOME';
my $OH = $ENV{$ORACLE_ENV} || '';
-$OH = win32_oracle_home($OH) if ($os eq 'MSWin32') or ($os =~ /cygwin/i);
+$OH = win32_oracle_home($OH) if ($os eq 'MSWin32') or ($os =~ /cygwin/i);
$OH = unixify $OH if $os eq 'VMS';
$OH =~ s:/$::;
@@ -153,6 +153,7 @@ if (!$OH) {
print "WARNING: If these tests fail you may have to set ORACLE_HOME yourself!\n";
sleep 5;
}
+-l $OH and $OH = Cwd::abs_path ($OH); # Oracle really dislikes symbolic links
die qq{ The $ORACLE_ENV environment variable value ($OH) is not valid.
It must be set to hold the path to an Oracle installation directory