mariuz / perl-dbd-firebird

Perl DBI driver for Firebird
15 stars 9 forks source link

Test fails due to missing symbol: is_ascii_string #23

Closed level420 closed 13 years ago

level420 commented 13 years ago

Hello Mariuz!

Trying to install (from github clone) on

centos 6 firebird 2.5.0

It builds but gives the following error in make test:

t/00-base.t ............... 1/2 
#   Failed test 'use DBD::Firebird;'
#   at t/00-base.t line 18.
#     Tried to use 'DBD::Firebird'.
#     Error:  Can't load '/development/perl/perl-dbd-firebird/blib/arch/auto/DBD/Firebird/Firebird.so' for module DBD::Firebird: /development/perl/perl-dbd-firebird/blib/arch/auto/DBD/Firebird/Firebird.so: undefined symbol: is_ascii_string at /usr/lib64/perl5/DynaLoader.pm line 200.
#  at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
# Looks like you failed 1 test of 2.
real-dam commented 13 years ago

It appears is_ascii_string is available only since perl 5.12.0 RC1. There should be some error during compilation?

What would be a good solution?

level420 commented 13 years ago

I'm running

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
level420 commented 13 years ago

As it seems that rhel 6 and centos 6 won't update to newer perl versions due to long time support it would be the best option to disable ib_enable_utf8 for perl version < 5.12 for now.

real-dam commented 13 years ago

please try cc84d89. I hope it will solve the issue. I'll try that myself later when I have access to perl 5.10

level420 commented 13 years ago

There is a typo in https://github.com/mariuz/perl-dbd-firebird/commit/cc84d89:

diff --git a/dbdimp.c b/dbdimp.c
index b2a21e5..d48a2b7 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -50,7 +50,7 @@ do {                                                         \
 #warning "Upgrading perl to 5.12 is suggested."
 // for perl before 5.12.0 RC1
 // taken straight from the perl source
-bool is_ascii_string(conts U8 *s, STRLEN len) {
+bool is_ascii_string(const U8 *s, STRLEN len) {
     const U8* const send = s + (len ? len : strlen((const char *)s));
     const U8* x = s;

After correcting the typo the module builds and passes all tests:

gcc -c  -I"/usr/include" -I"/usr/lib64/perl5/auto/DBI" -Wall -fno-strict-aliasing -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic   -DVERSION=\"0.70\" -DXS_VERSION=\"0.70\" -fPIC "-I/usr/lib64/perl5/CORE"   dbdimp.c
dbdimp.c:49:2: warning: #warning "Using built-in implementation of is_ascii_string."
dbdimp.c:50:2: warning: #warning "Upgrading perl to 5.12 is suggested."
Running Mkbootstrap for DBD::Firebird ()
chmod 644 Firebird.bs
rm -f blib/arch/auto/DBD/Firebird/Firebird.so
LD_RUN_PATH="/usr/lib64" gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic Firebird.o dbdimp.o  -o blib/arch/auto/DBD/Firebird/Firebird.so     \
           -L/usr/lib -lfbclient        \

chmod 755 blib/arch/auto/DBD/Firebird/Firebird.so
cp Firebird.bs blib/arch/auto/DBD/Firebird/Firebird.bs
chmod 644 blib/arch/auto/DBD/Firebird/Firebird.bs
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-base.t ............... ok   
t/01-connect.t ............ ok   
t/20-createdrop.t ......... ok   
t/30-insertfetch.t ........ ok     
t/31-prepare_cached.t ..... ok     
t/40-alltypes.t ........... ok     
t/41-bindparam.t .......... ok     
t/42-blobs.t .............. ok       
t/43-cursor.t ............. ok     
t/44-cursoron.t ........... ok     
t/45-datetime.t ........... ok     
t/46-listfields.t ......... ok     
t/47-nulls.t .............. ok     
t/48-numeric.t ............ ok     
t/49-scale.t .............. ok     
t/50-chopblanks.t ......... ok     
t/51-commit.t ............. ok     
t/60-leaks.t .............. skipped: Long memory leak test (try with MEMORY_TEST on linux)
t/61-settx.t .............. ok     
t/62-timeout.t ............ ok     
t/70-nested-sth.t ......... ok     
t/75-utf8.t ............... ok     
t/80-event-ithreads.t ..... ok     
t/81-event-fork.t ......... ok     
t/90-dbinfo.t ............. ok     
t/91-txinfo.t ............. ok   
t/92-bigdecimal_read.t .... ok     
t/93-bigdecimal.t ......... ok     
t/94-biginteger_read.t .... ok     
t/95-biginteger.t ......... ok     
t/dbi-primary_key_info.t .. ok     
t/dbi-rowcount.t .......... ok     
t/dbi-table_info.t ........ ok     
t/dbi-tables.t ............ ok   
t/rt49896.t ............... ok   
t/rt54561.t ............... ok   
t/rt55244.t ............... ok   
All tests successful.
Files=37, Tests=980, 19 wallclock secs ( 0.19 usr  0.36 sys +  2.26 cusr  0.75 csys =  3.56 CPU)
Result: PASS