Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 111956
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: vlmarek [...] volny.cz
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.50
Fixed in: (no value)



Subject: wrong sqlite header used when not using local compilation
Hi, Troublemaker here again :) Symptoms are: t/01_compile.t ........................................ 1/3 # Failed test 'use DBD::SQLite;' # at t/01_compile.t line 15. # Tried to use 'DBD::SQLite'. # Error: Can't load '/builds/vmarek/u-default/components/perl_modules/dbd-sqlite/build/i86-5.12/blib/arch/auto/DBD/SQLite/SQLite.so' for module DBD::SQLite: ld.so.1: perl: fatal: relocation error: file /builds/vmarek/u-default/components/perl_modules/dbd-sqlite/build/i86-5.12/blib/arch/auto/DBD/SQLite/SQLite.so: symbol sqlite3_strlike: referenced symbol not found at /usr/perl5/5.12/lib/i86pc-solaris-64int/DynaLoader.pm line 200. etc. The problem is that our local sqlite does not support 'sqlite3_strlike', because it's version older than 3.10. I am attaching the patch I used to fix it, but this time it's under-engineered (not generic enough IMO). Thank you __ Vlad
Subject: b.patch
--- DBD-SQLite-1.50/dbdimp.h 2016-02-11 13:17:06.945836816 -0800 +++ DBD-SQLite-1.50/dbdimp.h 2016-02-11 13:14:59.701455209 -0800 @@ -3,7 +3,7 @@ #define _DBDIMP_H 1 #include "SQLiteXS.h" -#include "sqlite3.h" +#include <sqlite3.h> #define MY_CXT_KEY "DBD::SQLite::_guts" XS_VERSION --- DBD-SQLite-1.50/Makefile.PL 2016-02-11 13:32:46.853644151 -0800 +++ DBD-SQLite-1.50/Makefile.PL 2016-02-11 13:32:20.811032084 -0800 @@ -215,6 +215,9 @@ my @CC_INC = ( '-I.', '-I$(DBI_INSTARCH_DIR)', ); +if ( not $sqlite_local ) { + unshift @CC_INC, '-I/usr/include'; +} if ( $sqlite_inc ) { push @CC_INC, "-I$sqlite_inc"; }
From: vlmarek [...] volny.cz
aaaaaand I forgot the main reason. sqlite3.h header is used from DBD-sqlite-1.50 directory instead of from /usr/include. So wrong SQLITE_VERSION is defined and thus we have a problem.
On Fri Feb 12 06:39:20 2016, neuron wrote: Show quoted text
> Hi, > > Troublemaker here again :) Symptoms are: > > t/01_compile.t ........................................ 1/3 > # Failed test 'use DBD::SQLite;' > # at t/01_compile.t line 15. > # Tried to use 'DBD::SQLite'. > # Error: Can't load '/builds/vmarek/u- > default/components/perl_modules/dbd-sqlite/build/i86- > 5.12/blib/arch/auto/DBD/SQLite/SQLite.so' for module DBD::SQLite: > ld.so.1: perl: fatal: relocation error: file /builds/vmarek/u- > default/components/perl_modules/dbd-sqlite/build/i86- > 5.12/blib/arch/auto/DBD/SQLite/SQLite.so: symbol sqlite3_strlike: > referenced symbol not found at /usr/perl5/5.12/lib/i86pc-solaris- > 64int/DynaLoader.pm line 200. > > etc. > > The problem is that our local sqlite does not support > 'sqlite3_strlike', because it's version older than 3.10. > > I am attaching the patch I used to fix it, but this time it's under- > engineered (not generic enough IMO). > > Thank you > __ > Vlad
Hi. I found another issue while looking into this... The following patch is to allow you to specify exactly where your lib and include are, like this: $ perl Makefile.PL SQLITE_INC=/path/to/inc SQLITE_LIB=/path/to/lib Does this also work for you, without modifying anything else? ----- diff --git a/Makefile.PL b/Makefile.PL index db5ddb5..199ab9c 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -129,7 +129,7 @@ SCOPE: { # a system sqlite is also sophisticated enough to have a patching system # that can change the if ( 0 ) to if ( 1 ) my ($sqlite_local, $sqlite_base, $sqlite_lib, $sqlite_inc); -if ( 0 ) { +if ( 1 ) { require File::Spec; if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) { $sqlite_base =~ /=(.*)/; @@ -146,6 +146,14 @@ if ( 0 ) { undef $sqlite_inc; } } + if ( my $my_inc = (grep /SQLITE_INC=.*/, @ARGV)[0] ) { + $my_inc =~ /=(.*)/; + $sqlite_inc = $1; + } + if ( my $my_lib = (grep /SQLITE_LIB=.*/, @ARGV)[0] ) { + $my_lib =~ /=(.*)/; + $sqlite_lib = $1; + } # Now check for a compatible sqlite3 unless ( $sqlite_local ) { @@ -194,7 +202,7 @@ if ( 0 ) { print "We're using the bundled sqlite library.\n" if $ENV{AUTOMATED_TESTING}; } -@ARGV = grep( ! /SQLITE_LOCATION|USE_LOCAL_SQLITE/, @ARGV ); +@ARGV = grep( ! /SQLITE_LOCATION|USE_LOCAL_SQLITE|SQLITE_LIB|SQLITE_INC/, @ARGV );
On Sat Feb 13 22:44:00 2016, ISHIGAKI wrote: Show quoted text
> On Fri Feb 12 06:39:20 2016, neuron wrote:
> > Hi, > > > > Troublemaker here again :) Symptoms are: > > > > t/01_compile.t ........................................ 1/3 > > # Failed test 'use DBD::SQLite;' > > # at t/01_compile.t line 15. > > # Tried to use 'DBD::SQLite'. > > # Error: Can't load '/builds/vmarek/u- > > default/components/perl_modules/dbd-sqlite/build/i86- > > 5.12/blib/arch/auto/DBD/SQLite/SQLite.so' for module DBD::SQLite: > > ld.so.1: perl: fatal: relocation error: file /builds/vmarek/u- > > default/components/perl_modules/dbd-sqlite/build/i86- > > 5.12/blib/arch/auto/DBD/SQLite/SQLite.so: symbol sqlite3_strlike: > > referenced symbol not found at /usr/perl5/5.12/lib/i86pc-solaris- > > 64int/DynaLoader.pm line 200. > > > > etc. > > > > The problem is that our local sqlite does not support > > 'sqlite3_strlike', because it's version older than 3.10. > > > > I am attaching the patch I used to fix it, but this time it's under- > > engineered (not generic enough IMO). > > > > Thank you > > __ > > Vlad
> > Hi. I found another issue while looking into this... > > The following patch is to allow you to specify exactly where your lib > and include are, like this: > > $ perl Makefile.PL SQLITE_INC=/path/to/inc SQLITE_LIB=/path/to/lib > > Does this also work for you, without modifying anything else? > > ----- > diff --git a/Makefile.PL b/Makefile.PL > index db5ddb5..199ab9c 100644 > --- a/Makefile.PL > +++ b/Makefile.PL > @@ -129,7 +129,7 @@ SCOPE: { > # a system sqlite is also sophisticated enough to have a patching > system > # that can change the if ( 0 ) to if ( 1 ) > my ($sqlite_local, $sqlite_base, $sqlite_lib, $sqlite_inc); > -if ( 0 ) { > +if ( 1 ) { > require File::Spec; > if ( $sqlite_base = (grep(/SQLITE_LOCATION=.*/, @ARGV))[0] ) { > $sqlite_base =~ /=(.*)/; > @@ -146,6 +146,14 @@ if ( 0 ) { > undef $sqlite_inc; > } > } > + if ( my $my_inc = (grep /SQLITE_INC=.*/, @ARGV)[0] ) { > + $my_inc =~ /=(.*)/; > + $sqlite_inc = $1; > + } > + if ( my $my_lib = (grep /SQLITE_LIB=.*/, @ARGV)[0] ) { > + $my_lib =~ /=(.*)/; > + $sqlite_lib = $1; > + } > > # Now check for a compatible sqlite3 > unless ( $sqlite_local ) { > @@ -194,7 +202,7 @@ if ( 0 ) { > print "We're using the bundled sqlite library.\n" if > $ENV{AUTOMATED_TESTING}; > } > > -@ARGV = grep( ! /SQLITE_LOCATION|USE_LOCAL_SQLITE/, @ARGV ); > +@ARGV = grep( ! > /SQLITE_LOCATION|USE_LOCAL_SQLITE|SQLITE_LIB|SQLITE_INC/, @ARGV );
Applied the above without if ( 1 ) and shipped as 1.51_03.
Closed as 1.52 is out. Thanks.