bduggan / Module-Build-Database

Module::Build::Database -- manage your database, Module::Build style
1 stars 2 forks source link

tests fail when plperl is different from the installing perl and using PERL5LIB #5

Closed plicease closed 11 years ago

plicease commented 11 years ago

Environment is:

Problem:

The problem is that plperl is trying to use the perlbrew lib (because of PERL5LIB) which doesn't work with that version of perl.

Part of this has to do with Module::Build because it is putting the x86_64-linux directory into PERL5LIB (prove does NOT do that, that is why it doesn't fail).

I tried wrapping system calls with do { local $ENV{PERL5LIB} =''; system(...) } but that wasn't quite enough to fix it.

This only happens in the test suite, I don't have the same problem when using MBD once it is installed.

I will look at this myself when I get a chance, but I wanted to write down some notes while it was fresh in my mind and I thought opening an issue would be the best way to do this.

iscah% perl Build.PL 
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Module-Build-Database' version '0.48'
iscah% ./Build test
t/00-load.t ................ 1/1 # Testing Module::Build::Database 0.48, Perl 5.016003, /home/ollisg/perl5/perlbrew/perls/perl-5.16.3/bin/perl
t/00-load.t ................ ok   
t/01-install-postgis.t ..... skipped: No postgis.sql, set TEST_POSTGIS_BASE to a directory containing postgis.sql to enable this test
t/02-install-no-postgis.t .. 2/? 
#   Failed test './Build dbtest'
#   at /home/ollisg/dev/Module-Build-Database/t/tlib/misc.pm line 16.
# ./Build dbtest failed : 65280 65280
# # starting test database
# waiting for server to start.... done
# server started
# Can't load '/home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so' for module Socket: /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so: undefined symbol: PL_stack_sp at /usr/share/perl/5.14/XSLoader.pm line 71.
#  at /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/Socket.pm line 858
# Compilation failed in require at /usr/share/postgresql-common/PgCommon.pm line 18.
# BEGIN failed--compilation aborted at /usr/share/postgresql-common/PgCommon.pm line 18.
# Compilation failed in require at /usr/bin/psql line 24.
# BEGIN failed--compilation aborted at /usr/bin/psql line 24.
# Can't load '/home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so' for module Socket: /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so: undefined symbol: PL_stack_sp at /usr/share/perl/5.14/XSLoader.pm line 71.
#  at /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/Socket.pm line 858
# Compilation failed in require at /usr/share/postgresql-common/PgCommon.pm line 18.
# BEGIN failed--compilation aborted at /usr/share/postgresql-common/PgCommon.pm line 18.
# Compilation failed in require at /usr/bin/createdb line 24.
# BEGIN failed--compilation aborted at /usr/bin/createdb line 24.
# Error with '/usr/bin/createdb scooby' : 65280 65280
# could not createdb at /home/ollisg/dev/Module-Build-Database/t/../blib/lib/Module/Build/Database/PostgreSQL.pm line 415.
t/02-install-no-postgis.t .. 3/? 
#   Failed test './Build dbdist'
#   at /home/ollisg/dev/Module-Build-Database/t/tlib/misc.pm line 16.
# ./Build dbdist failed : 768 768
# waiting for server to start.... done
# server started
# Can't load '/home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so' for module Socket: /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so: undefined symbol: PL_stack_sp at /usr/share/perl/5.14/XSLoader.pm line 71.
#  at /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/Socket.pm line 858
# Compilation failed in require at /usr/share/postgresql-common/PgCommon.pm line 18.
# BEGIN failed--compilation aborted at /usr/share/postgresql-common/PgCommon.pm line 18.
# Compilation failed in require at /usr/bin/psql line 24.
# BEGIN failed--compilation aborted at /usr/bin/psql line 24.
# Can't load '/home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so' for module Socket: /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so: undefined symbol: PL_stack_sp at /usr/share/perl/5.14/XSLoader.pm line 71.
#  at /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/Socket.pm line 858
# Compilation failed in require at /usr/share/postgresql-common/PgCommon.pm line 18.
# BEGIN failed--compilation aborted at /usr/share/postgresql-common/PgCommon.pm line 18.
# Compilation failed in require at /usr/bin/createdb line 24.
# BEGIN failed--compilation aborted at /usr/bin/createdb line 24.
# Error with '/usr/bin/createdb scooby' : 65280 65280
# could not createdb at /home/ollisg/dev/Module-Build-Database/t/../blib/lib/Module/Build/Database/PostgreSQL.pm line 415.

#   Failed test 'created base.sql'
#   at t/02-install-no-postgis.t line 49.

#   Failed test 'created patches_applied.txt'
#   at t/02-install-no-postgis.t line 50.
t/02-install-no-postgis.t .. 7/? 
#   Failed test './Build dbfakeinstall'
#   at /home/ollisg/dev/Module-Build-Database/t/tlib/misc.pm line 16.
# ./Build dbfakeinstall failed : 512 512
# no db/dist dir, cannot fakeinstall at /home/ollisg/dev/Module-Build-Database/t/../blib/lib/Module/Build/Database.pm line 388.

#   Failed test './Build dbinstall'
#   at /home/ollisg/dev/Module-Build-Database/t/tlib/misc.pm line 16.
# ./Build dbinstall failed : 512 512
# no db/dist dir, cannot install at /home/ollisg/dev/Module-Build-Database/t/../blib/lib/Module/Build/Database.pm line 454.
Can't load '/home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so' for module Socket: /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/auto/Socket/Socket.so: undefined symbol: PL_stack_sp at /usr/share/perl/5.14/XSLoader.pm line 71.
 at /home/ollisg/.perlbrew/libs/perl-5.16.3@dev/lib/perl5/x86_64-linux/Socket.pm line 858
Compilation failed in require at /usr/share/postgresql-common/PgCommon.pm line 18.
BEGIN failed--compilation aborted at /usr/share/postgresql-common/PgCommon.pm line 18.
Compilation failed in require at /usr/bin/psql line 24.
BEGIN failed--compilation aborted at /usr/bin/psql line 24.

#   Failed test 'made table one in schema doo'
#   at t/02-install-no-postgis.t line 77.
#                   ''
#     doesn't match '(?^i:table.*doo\.one)'

#   Failed test 'made column x type integer'
#   at t/02-install-no-postgis.t line 78.
#                   ''
#     doesn't match '(?^:x.*integer)'
t/02-install-no-postgis.t .. 12/? # Looks like you failed 8 tests of 12.
t/02-install-no-postgis.t .. Dubious, test returned 8 (wstat 2048, 0x800)
Failed 8/12 subtests 
t/03-install-sqlite.t ...... ok   
t/04-install_path.t ........ ok   
t/05-plperl.t .............. skipped: set TEST_PLPERL to enable test
t/pod.t .................... ok   

Test Summary Report
-------------------
t/02-install-no-postgis.t (Wstat: 2048 Tests: 12 Failed: 8)
  Failed tests:  2-5, 8-11
  Non-zero exit status: 8
Files=7, Tests=32, 10 wallclock secs ( 0.04 usr  0.01 sys +  3.67 cusr  0.96 csys =  4.68 CPU)
Result: FAIL
Failed 1/7 test programs. 8/32 subtests failed.
plicease commented 11 years ago

I am now seeing this on my workstation that has the perlbrew perl but plperl is NOT installed. psql seems to crash when the PERL5LIB is set the way MB does it. is psql linked to libperl? That seems weird.

plicease commented 11 years ago

fixed by #7