Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 40257
Status: resolved
Priority: 0/
Queue: Test-Harness

People
Owner: mschwern [...] cpan.org
Requestors: HMBRAND [...] cpan.org
Cc:
AdminCc:

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



Subject: Tests fail if $PERL5LIB is set to the blib components of the module path
$ echo $PERL5LIB /pro/3gl/CPAN/Module-Build-0.30/blib/lib:/pro/3gl/CPAN/Module- Build-0.30/blib/arch:/pro/3gl/CPAN/Module-Build-0.30/blib $ pwd /pro/3gl/CPAN/Module-Build-0.30 $ make test : /pro/bin/perl Build --makefile_env_macros 1 test t/basic...............1/52 # Failed test 'Make sure Module::Build was loaded from blib/' # at t/lib/MBTest.pm line 175. # 'lib/Module/Build.pm' # doesn't match '(?-xism:\bblib\b)' t/basic...............24/52 # Looks like you failed 1 test of 52. t/basic............... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/52 subtests t/compat..............1/124
Subject: Re: [rt.cpan.org #40257] Tests fail if $PERL5LIB is set to the blib components of the module path
Date: Wed, 22 Oct 2008 01:19:56 -0700
To: bug-Module-Build [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
HMBRAND via RT wrote: Show quoted text
> $ echo $PERL5LIB > /pro/3gl/CPAN/Module-Build-0.30/blib/lib:/pro/3gl/CPAN/Module- > Build-0.30/blib/arch:/pro/3gl/CPAN/Module-Build-0.30/blib > $ pwd > /pro/3gl/CPAN/Module-Build-0.30 > $ make test > : > /pro/bin/perl Build --makefile_env_macros 1 test > t/basic...............1/52 > # Failed test 'Make sure Module::Build was loaded from blib/' > # at t/lib/MBTest.pm line 175. > # 'lib/Module/Build.pm' > # doesn't match '(?-xism:\bblib\b)' > t/basic...............24/52 # Looks like you failed 1 test of 52. > t/basic............... Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/52 subtests > t/compat..............1/124
I suspect the problem might be how Test::Harness reconstructs @INC stripping out duplicate @INC entries (in this case the blib ones), but I haven't nailed it down yet. -- 164. There is no such thing as a were-virgin. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
CC: Development [...] a-sasl-fastnet.sasl.smtp.pobox.com, of [...] a-sasl-fastnet.sasl.smtp.pobox.com, "TAPx:" [...] a-sasl-fastnet.sasl.smtp.pobox.com:Parser <tapx-dev [...] hexten.net>
Subject: Re: [rt.cpan.org #40257] Tests fail if $PERL5LIB is set to the blib components of the module path
Date: Wed, 22 Oct 2008 10:49:41 -0700
To: bug-Module-Build [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Michael G Schwern via RT wrote: Show quoted text
> I suspect the problem might be how Test::Harness reconstructs @INC stripping > out duplicate @INC entries (in this case the blib ones), but I haven't nailed > it down yet.
Yep, here's the sequence of events... When I run: perl Build.PL then PERL5LIB=$PWD/blib/lib:$PWD/blib/arch:$PWD/blib:$HOME/devel/Test-Harness/lib build test --test_files t/basic.t Just before Module::Build calls TAP::Harness->new, @INC is this: /Users/schwern/devel/Module-Build/blib/lib /Users/schwern/devel/Module-Build/blib/arch inc t/lib t/bundled lib /sw/lib/perl5/darwin-thread-multi-2level /sw/lib/perl5 /sw/lib/perl5/darwin /Users/schwern/devel/Module-Build/blib/lib /Users/schwern/devel/Module-Build/blib/arch /Users/schwern/devel/Module-Build/blib /Users/schwern/devel/Test-Harness/lib /usr/local/perl/5.10.0/lib/5.10.0/darwin-thread-multi-2level /usr/local/perl/5.10.0/lib/5.10.0 /usr/local/perl/5.10.0/lib/site_perl/5.10.0/darwin-thread-multi-2level /usr/local/perl/5.10.0/lib/site_perl/5.10.0 . Note the doubled blib entries, that's what's supposed to be there. This is what TAP::Harness::Source::Perl sets PERL5LIB to: inc:t/lib:t/bundled:lib:/sw/lib/perl5/darwin-thread-multi-2level:/sw/lib/perl5:/sw/lib/perl5/darwin:/Users/schwern/devel/Module-Build/blib/lib:/Users/schwern/devel/Module-Build/blib/arch:/Users/schwern/devel/Module-Build/blib:/Users/schwern/devel/Test-Harness/lib And the command it runs: /usr/local/perl/5.10.0/bin/perl -w t/basic.t Something inside TAP::Harness is stripping out duplicate @INC entries but it's taking them off the front, not the back. -- 40. I do not have super-powers. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
The issue is the code in Test::Harness::_aggregate() that takes all the extra @INC entries and puts them together onto PERL5LIB. It effectively does this: $PERL5LIB = $extra_inc . $old_PERL5LIB; when it should be the other way around. Patch and test forthcoming.
Fixed in r1239.