Skip Menu |

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 122568
Status: open
Priority: 0/
Queue: Module-Build

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

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



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 .
On Sat Jul 22 23:36:12 2017, SPROUT wrote: Show quoted text
> > 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.
This is turning out to be a heisenbug that I can no longer reproduce. I was able to reproduce it consistently within a particular session of the CPAN shell, but when I restarted the CPAN shell the problem went away. Again, I tried dumping @INC from test_reqs.t, and found that it was in the right order. So something that CPAN.pm added to PERL5LIB must have been screwing up the order of @INC, which is *very* strange. Does anyone have any idea which module could have caused that? I may be misremembering, but I think I installed Mouse and Function::Parameters (and their prerequisites) before that.
I believe I have found the problem. I often test many modules within a single CPAN shell session. Depending on the order in which dependencies are processed, the PERL5LIB variable may change significantly between Build.PL ./Build test. But the Build script has the @INC from configure (Build.PL) time hard-coded in it. That hard-coded @INC gets inserted at the beginning of @INC list, which means that the modules then get looked for in a different, sometimes wrong, order. Why does the Build script need to have a hard-coded @INC? If Build.PL is run with a PERL5LIB set to a specific value, then surely whatever set it can be trusted to give it a correct value at test time, no? BTW, this time I encountered this problem with perl 5.27.6, so it is not just an Old Perl problem. And the Module::Build version was 0.4224, in case that matters.
On Fri Nov 03 00:30:33 2017, SPROUT wrote: Show quoted text
> Why does the Build script need to have a hard-coded @INC? If Build.PL > is run with a PERL5LIB set to a specific value, then surely whatever > set it can be trusted to give it a correct value at test time, no?
I don't really agree with that behavior either, but it appears it's too late to change it now. Leon