Subject: | Fails tests under 5.12 on Mac due to @INC reordering |
Module::Build 0.4224’s t/test_reqs.t fails on my Mac 10.8 system perl (5.12.4), because ‘./Build test’ reorders @INC.
The failure looks like this:
Parse::CPAN::Meta version 1.44 required--this is only version 1.40 at /Library/Perl/5.12/CPAN/Meta/Converter.pm line 27.
BEGIN failed--compilation aborted at /Library/Perl/5.12/CPAN/Meta/Converter.pm line 27.
Compilation failed in require at /Library/Perl/5.12/CPAN/Meta.pm line 58.
BEGIN failed--compilation aborted at /Library/Perl/5.12/CPAN/Meta.pm line 58.
Compilation failed in require at t/test_reqs.t line 8.
BEGIN failed--compilation aborted at t/test_reqs.t line 8.
t/test_reqs.t .................. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
If I dump %INC and @INC, I can see that Parse::CPAN::Meta is being loaded from /System/Library/Perl/5.12/Parse/CPAN/Meta.pm, and that @INC contains everything from PERL5LIB (set by the CPAN shell) and the following:
'/Library/Perl/Updates/5.12.4/darwin-thread-multi-2level',
'/Library/Perl/Updates/5.12.4',
'/System/Library/Perl/5.12/darwin-thread-multi-2level',
'/System/Library/Perl/5.12',
'/System/Library/Perl/Extras/5.12/darwin-thread-multi-2level',
'/System/Library/Perl/Extras/5.12',
'/Users/sprout/.cpan/build/Module-Build-0.4224-aF1vTO',
'/Library/Perl/5.12/darwin-thread-multi-2level',
'/Library/Perl/5.12',
'/Network/Library/Perl/5.12/darwin-thread-multi-2level',
'/Network/Library/Perl/5.12',
'/Users/sprout/.cpan/build/Module-Build-0.4224-aF1vTO/t/bundled',
'.'
If I run the test script directly myself, without using ‘./Build test’, it loads Parse::CPAN::Meta from Library/Perl/5.12 (the right version), and the @INC order is:
'/Library/Perl/5.12/darwin-thread-multi-2level',
'/Library/Perl/5.12',
'/Network/Library/Perl/5.12/darwin-thread-multi-2level',
'/Network/Library/Perl/5.12',
'/Library/Perl/Updates/5.12.4/darwin-thread-multi-2level',
'/Library/Perl/Updates/5.12.4',
'/System/Library/Perl/5.12/darwin-thread-multi-2level',
'/System/Library/Perl/5.12',
'/System/Library/Perl/Extras/5.12/darwin-thread-multi-2level',
'/System/Library/Perl/Extras/5.12',
'.'
So something in ‘./Build test’ is changing the order of my @INC and causing failures.
perl -V output:
Summary of my perl5 (revision 5 version 12 subversion 4) configuration:
Platform:
osname=darwin, osvers=12.0, archname=darwin-thread-multi-2level
uname='darwin b1026.apple.com 12.0 darwin kernel version 12.0.0: tue may 15 23:31:29 pdt 2012; root:xnu-2050.6.70~1release_x86_64 x86_64 '
config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=clang'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='clang', ccflags ='-arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include',
optimize='-Os',
cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='clang -mmacosx-version-min=10.8', ldflags ='-arch i386 -arch x86_64 -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-arch i386 -arch x86_64 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL
USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
Locally applied patches:
/Library/Perl/Updates/<version> comes before system perl directories
installprivlib and installarchlib points to the Updates directory
Built under darwin
Compiled at Jun 20 2012 13:55:28
@INC:
/Library/Perl/5.12/darwin-thread-multi-2level
/Library/Perl/5.12
/Network/Library/Perl/5.12/darwin-thread-multi-2level
/Network/Library/Perl/5.12
/Library/Perl/Updates/5.12.4/darwin-thread-multi-2level
/Library/Perl/Updates/5.12.4
/System/Library/Perl/5.12/darwin-thread-multi-2level
/System/Library/Perl/5.12
/System/Library/Perl/Extras/5.12/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.12
.