Skip Menu |

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

Maintainer(s)' notes

Attention bug reporters: issues MUST include the version of Module::Metadata that you are running that exhibit the stated symptoms. thank you!

Report information
The Basics
Id: 65380
Status: resolved
Priority: 0/
Queue: Module-Metadata

People
Owner: Nobody in particular
Requestors: jjore [...] cpan.org
Cc:
AdminCc:

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



Subject: find_module_by_name fails
PERL_DL_NONLAZY=1 /opt/perl/install/64bitint/perl-5.6.1/bin/perl -Iblib/arch -Iblib/lib -I/opt/perl/install/64bitint/perl-5.6.1/lib/5.6.1/i686-linux-64int -I/opt/perl/install/64bitint/perl-5.6.1/lib/5.6.1 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/metadata.t .. 1/99 Use of uninitialized value in -e at t/metadata.t line 193. # Failed test 'find_module_by_name() succeeds' # at t/metadata.t line 193. # Looks like you failed 1 test of 99. t/metadata.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/99 subtests (less 8 skipped subtests: 90 okay) Test Summary Report ------------------- t/metadata.t (Wstat: 256 Tests: 99 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=1, Tests=99, 1 wallclock secs ( 0.15 usr 0.02 sys + 0.62 cusr 0.16 csys = 0.95 CPU) Result: FAIL Failed 1/1 test programs. 1/99 subtests failed. make: *** [test_dynamic] Error 11 Test passes when run manually: Using /home/josh/.cpan/build/Module-Metadata-1.000003/blib 1..99 ok 1 - require Module::Metadata; ok 2 - find_module_by_name() succeeds ok 3 - fail if can't find module by module name ok 4 - fail if can't find module by file name ok 5 - new_from_file() succeeds ok 6 - new_from_module() succeeds ok 7 - correct module version (expected '1.23') ok 8 - no warnings from parsing ok 9 # skip No package NAME VERSION support until perl 5.11.1 ok 10 # skip No package NAME VERSION support until perl 5.11.1 ok 11 # skip No package NAME VERSION support until perl 5.11.1 ok 12 # skip No package NAME VERSION support until perl 5.11.1 ok 13 # skip No package NAME VERSION support until perl 5.11.1 ok 14 # skip No package NAME VERSION support until perl 5.11.1 ok 15 # skip No package NAME VERSION support until perl 5.11.1 ok 16 # skip No package NAME VERSION support until perl 5.11.1 ok 17 - correct module version (expected '1.23') ok 18 - no warnings from parsing ok 19 - correct module version (expected '1.23') ok 20 - no warnings from parsing ok 21 - correct module version (expected '1.234') ok 22 - no warnings from parsing ok 23 - correct module version (expected '0') ok 24 - no warnings from parsing ok 25 - correct module version (expected '1.23') ok 26 - no warnings from parsing ok 27 - correct module version (expected '1.23') ok 28 - no warnings from parsing ok 29 - correct module version (expected '1.23') ok 30 - no warnings from parsing ok 31 - correct module version (expected '1.23') ok 32 - no warnings from parsing ok 33 - correct module version (expected '1.23') ok 34 - no warnings from parsing ok 35 - correct module version (expected '1.23') ok 36 - no warnings from parsing ok 37 - correct module version (expected '1.23') ok 38 - no warnings from parsing ok 39 - correct module version (expected '1.23') ok 40 - no warnings from parsing ok 41 - correct module version (expected '1.23') ok 42 - no warnings from parsing ok 43 - correct module version (expected '1.23') ok 44 - no warnings from parsing ok 45 - correct module version (expected '1.23') ok 46 - no warnings from parsing ok 47 - correct module version (expected '1.23') ok 48 - no warnings from parsing ok 49 - correct module version (expected '1.23') ok 50 - no warnings from parsing ok 51 - correct module version (expected '1.23') ok 52 - no warnings from parsing ok 53 - correct module version (expected '1.23') ok 54 - no warnings from parsing ok 55 - correct module version (expected '1.23') ok 56 - no warnings from parsing ok 57 - correct module version (expected '1.23') ok 58 - no warnings from parsing ok 59 - correct module version (expected '1.23') ok 60 - no warnings from parsing ok 61 - correct module version (expected '1.23') ok 62 - no warnings from parsing ok 63 - correct module version (expected '1.23') ok 64 - no warnings from parsing ok 65 - correct module version (expected '1.23') ok 66 - no warnings from parsing ok 67 - correct module version (expected '1.23') ok 68 - no warnings from parsing ok 69 - record only one occurence of each package ok 70 - no default package ok 71 - no version w/o default package ok 72 - alpha version reported ok 73 - alpha version greater than non ok 74 - correct script version (1 of 8) ok 75 - correct script version (2 of 8) ok 76 - correct script version (3 of 8) ok 77 - correct script version (4 of 8) ok 78 - correct script version (5 of 8) ok 79 - correct script version (6 of 8) ok 80 - correct script version (7 of 8) ok 81 - correct script version (8 of 8) ok 82 - found default package ok 83 - version for default package ok 84 - version for secondary package ok 85 - filename() returns valid path to module file ok 86 - found correct number of packages ok 87 - packages stored in order found ok 88 - contains_pod() succeeds ok 89 - found all pod sections ok 90 - return undef() if pod section not present ok 91 - return undef() if pod section not collected ok 92 - collected pod section ok 93 - found default package ok 94 - version for default package ok 95 - packages inside ok 96 - found default package ok 97 - version for default package ok 98 - packages inside ok 99 - version for embedded package
The test expects to find Module/Metadata.pm somewhere in @INC after doing a chdir() to a directory it's created. In this case, the @INC path for blib/arch was relative and no longer worked after the chdir() away from ~/.cpan/build/Module-Metadata-1.000003/.
Further, it appears that ExtUtils::MakeMaker 5.45 generates code that uses relative -I blib/arch parameters and doesn't absolutify them or use blib.pm. This may be resolveable by either using Cwd+File::Spec in t/metadata.t to ensure @INC is absolute or by depending on a sufficiently high enough version of ExtUtils::MakeMaker that generates better code. test_dynamic :: pure_all PERL_DL_NONLAZY=1 $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runt\ ests @ARGV;' $(TEST_FILES)
Fix attached
Subject: 0001-Find-Module-Metadata.pm-in-blib-arch-before-chdir-RT.patch
From f03c1d611316ffeef39991cd9f8db45b7612145c Mon Sep 17 00:00:00 2001 From: Josh Jore <jjore@cpan.org> Date: Wed, 2 Feb 2011 17:00:36 -0800 Subject: [PATCH] Find Module/Metadata.pm in blib/arch before chdir() [RT #65380] --- t/metadata.t | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/t/metadata.t b/t/metadata.t index 7f5cd92..f3d08aa 100644 --- a/t/metadata.t +++ b/t/metadata.t @@ -177,6 +177,13 @@ plan tests => 37 + 2 * keys( %modules ); require_ok('Module::Metadata'); +# class method C<find_module_by_name> +my $module = Module::Metadata->find_module_by_name( + 'Module::Metadata' ); +ok( -e $module, 'find_module_by_name() succeeds' ); + +######################### + my $tmp = MBTest->tmpdir; use DistGen; @@ -185,13 +192,6 @@ $dist->regen; $dist->chdir_in; -######################### - -# class method C<find_module_by_name> -my $module = Module::Metadata->find_module_by_name( - 'Module::Metadata' ); -ok( -e $module, 'find_module_by_name() succeeds' ); - # fail on invalid module name my $pm_info = Module::Metadata->new_from_module( -- 1.7.1
Thank you. Uploaded 1.000004 to CPAN.