Hello,

I'm not sure if this is a bug or a user error, so I thought I would send this 
email first. If this is a bug, I can file a bug report for it in Bugzilla.

I am building Perl and associated libraries for a cross-compiled environment 
(qemu x86_64 target) from an x86_64 build machine for the Open Source Yocto 
project. This is with Perl 5.22.1 (MakeMaker 7.04_01). As part of the 
verification process, I am running the test cases on the targetr and get 
several failures on the MakeMaker tests. t/basic.t is one such example; the 
other failing tests fail in the same manner.

The error is:

cpan/ExtUtils-MakeMaker/t/basic ..............
1..0 # SKIP cross-compiling and make not available
No root path(s) specified
 at t/basic.t line 83.
ok 1
ok 2 - teardown
# Tests were run but no plan was declared and done_testing() was not seen.
FAILED--expected 0 tests, saw 2

basic.t contains (in part):

use ExtUtils::MakeMaker;
   :
   :
use Config;
use Test::More;
use ExtUtils::MM;

plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
    ? (skip_all => "cross-compiling and make not available")
    : (tests => 171);
use File::Find;
   :
   :

I am finding that the call MM->can_run(make()) returns undef. make() is defined 
in ExtUtils::MM_Any.pm, but it appears to never be called. In addition, make() 
relies on the value of $self->MAKE, which is set in init_MAKE(), also defined 
in ExtUtils::MM_Any.pm and never called.

Now, I can get this code to work by changing it to look like this:

my $mm = ExtUtils::MM->new();
plan !$mm->can_run($mm->make()) && ...

(init_MAKE() gets called from new(), to set the internal value for MAKE which 
is used when make() is called.)

As an aside, the cryptic "No root path(s) specified..." error message is caused 
by this line:
END { rmtree $DUMMYINST; }
which always gets executed, even if no tests are run and $DUMMYINST is not 
initialized. I changed this line to:
END { rmtree $DUMMYINST if defined $DUMMYINST; }

So, my questions are:

1. How is this intended to work and why did it presumably work when originally 
written and committed? IOW, my perl knowledge is obviously lacking here. [One 
potential answer here is that it was never tested in a cross-compile 
environment, since when $Config{'usecrosscompile'} is not defined, the value 
for MM->can_run() doesn't matter, as the plan expression will end up always 
being true.]

2. I notice some other tests use MM->can_run($Config{make}). That would work 
here, too, and solve the problem, but $Config{make} could be different than the 
value returned by make(); does that really matter here?

    -Bill Randle
    Sr. Software Engineer
    Intel Corp.

Reply via email to