# from Eric Wilhelm
# on Monday 09 February 2009 22:05:

># from David Golden
>
># on Monday 09 February 2009 20:06:
>>  See some
>>of the many red and orange blocks at
>>http://bbbike.radzeit.de/~slaven/cpantestersmatrix.cgi?dist=Module-Bu
>>ild+0.31_03 for examples.
>
>  PERL5LIB=t/lib:t/bundled:lib::.../Module-Build-0.31_03/blib/lib:...
>
>CPANPLUS add_to_includepath() *pushes* to @INC and *appends* to
>PERL5LIB, so whatever was in there first takes precedence.

I suppose that's a red herring, sort of.  The problem is with 
Test::Harness 3+ prepending to PERL5LIB anything which is in @INC, but 
skipping those items which are already in PERL5LIB, which changes the 
priority around.

The reason this appears in CPANPLUS is that CPANPLUS sets the 
blib/{lib,arch} in PERL5LIB before running the tests?  That is, it only 
happens when PERL5LIB already contains the blib/{lib,arch}, which then 
get bumped to after the lib/ in the testing process.

This patch would "fix" it.  It will also cause "Use of uninitialized 
value in join or string at .../TAP/Parser/Source/Perl.pm line 135" 
warnings.  Should we just prefer to use TAP::Harness if it is 
available?

Index: lib/Module/Build/Base.pm
===================================================================
--- lib/Module/Build/Base.pm    (revision 12488)
+++ lib/Module/Build/Base.pm    (working copy)
@@ -2297,6 +2297,7 @@
            $ENV{TEST_VERBOSE},
            $ENV{HARNESS_VERBOSE}) = ($p->{verbose} || 0) x 4;

+    local $ENV{PERL5LIB};
     Test::Harness::runtests(@$tests);
 }

--Eric
-- 
If the collapse of the Berlin Wall had taught us anything, it was that
socialism alone was not a sustainable economic model.
--Robert Young
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to