Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 19836
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: chris+rt [...] chrisdolan.net
Requestors: cubrewer [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.16
Fixed in: 0.17



Subject: Perl-Critic0.16 fails tests during install
Cannot install the module. Using Perl 5.8.5 on Fedora Core 3. Show quoted text
cpan> install Perl::Critic
Running install for module Perl::Critic Running make for T/TH/THALJEF/perlcritic/Perl-Critic-0.16.tar.gz Is already unwrapped into directory /root/.cpan/build/Perl-Critic-0.16 Has already been processed within this session Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00_modules..........................ok t/01_config...........................Can't locate object method "default_severity" via package "Perl::Critic::Policy::Variables" at /root/.cpan/build/Perl-Critic-0.16/blib/lib/Perl/Critic/Config.pm line 89. # Looks like your test died before it could output anything. t/01_config...........................dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-46 Failed 46/46 tests, 0.00% okay t/02_policy...........................ok t/03_pragmas..........................Can't locate object method "default_severity" via package "Perl::Critic::Policy::Variables" at /root/.cpan/build/Perl-Critic-0.16/blib/lib/Perl/Critic/Config.pm line 89. # Looks like your test died before it could output anything. t/03_pragmas..........................dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-28 Failed 28/28 tests, 0.00% okay t/05_utils............................ok t/06_violation........................ok t/07_perlcritic.......................ok t/20_policies_builtinfunctions........ok t/20_policies_classhierarchies........ok t/20_policies_codelayout..............ok t/20_policies_controlstructures.......ok t/20_policies_documentation...........ok t/20_policies_inputoutput.............ok t/20_policies_miscellanea.............ok t/20_policies_modules.................ok t/20_policies_namingconventions.......ok t/20_policies_references..............ok t/20_policies_regularexpressions......ok t/20_policies_subroutines.............ok t/20_policies_testinganddebugging.....ok t/20_policies_valuesandexpressions....ok t/20_policies_variables...............ok t/98_pod_syntax.......................skipped all skipped: Test::Pod 1.00 required for testing POD t/99_pod_coverage.....................skipped all skipped: Test::Pod::Coverage 1.00 requried to test POD Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/01_config.t 255 65280 46 92 200.00% 1-46 t/03_pragmas.t 255 65280 28 56 200.00% 1-28 2 tests skipped. Failed 2/24 test scripts, 91.67% okay. 74/1195 subtests failed, 93.81% okay. make: *** [test_dynamic] Error 255 /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force Failed during this command: THALJEF/perlcritic/Perl-Critic-0.16.tar.gz : make_test NO
From: cdolan [...] cpan.org
It looks to me like you have a Variables.pm file installed somewhere on the system outside of the Perl-Critic dir. Could you run the following command and share the results? locate Variables.pm If that turns up a Perl::Critic::Policy::Variables module on your system, then you should probably delete it. If not, then we'll have to do some further investigation. NOTE TO DEVELOPERS: To help avoid future problems with external policy modules (whether or not that is the actual problem here) I've just committed a change to do two things: 1) Refuse to load Policy modules that don't comply with the basic Policy.pm API (namely, must support default_severity and applies_to methods). 2) 01_config.t deliberately loads only from blib, if /blib/ is in @INC.
Subject: Re: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install
Date: Mon, 12 Jun 2006 09:20:29 -0700 (PDT)
To: bug-Perl-Critic [...] rt.cpan.org
From: Alan Mead <cubrewer [...] yahoo.com>
I get nothing: [amead@ugly temp2]$ locate Variables.pm [amead@ugly temp2]$ Let me know what something else is... -Alan Show quoted text
----- Original Message ---- From: via RT <bug-Perl-Critic@rt.cpan.org> To: cubrewer@yahoo.com Sent: Monday, June 12, 2006 8:45:05 AM Subject: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install <URL: http://rt.cpan.org/Ticket/Display.html?id=19836 > It looks to me like you have a Variables.pm file installed somewhere on the system outside of the Perl-Critic dir. Could you run the following command and share the results? locate Variables.pm If that turns up a Perl::Critic::Policy::Variables module on your system, then you should probably delete it. If not, then we'll have to do some further investigation. NOTE TO DEVELOPERS: To help avoid future problems with external policy modules (whether or not that is the actual problem here) I've just committed a change to do two things: 1) Refuse to load Policy modules that don't comply with the basic Policy.pm API (namely, must support default_severity and applies_to methods). 2) 01_config.t deliberately loads only from blib, if /blib/ is in @INC.
On Mon Jun 12 12:20:44 2006, cubrewer@yahoo.com wrote: Show quoted text
> I get nothing: > > [amead@ugly temp2]$ locate Variables.pm > [amead@ugly temp2]$ > > Let me know what something else is... > > -Alan
Huh, that's surprising. Do you have a ~/.perlcriticrc that you've created? I'm rapidly running out of ideas... Chris
Subject: Re: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install
Date: Mon, 12 Jun 2006 11:27:34 -0700 (PDT)
To: bug-Perl-Critic [...] rt.cpan.org
From: Alan Mead <cubrewer [...] yahoo.com>
Nope. No ~/.perlcriticrc. So, the error occurs in the second line of the below code block, right? And the only method invocation is ->default_severity, right? Where does the elements of @SITE_POLICIES come from? #Don't load policy if it is below the severity threshold my $severity = $params->{severity} || $policy_long->default_severity; if ( $severity < $min_severity ) { $load_me = $FALSE; } In native_policies() there is a comment about the list being sorted... on my FC3 machine sort sorts the below blocks differently... could that have anything to do with this problem? Perl::Critic::Policy::ControlStructures::ProhibitCStyleForLoops Perl::Critic::Policy::ControlStructures::ProhibitCascadingIfElse (on my machine, Cascasde comes before CStyle) Perl::Critic::Policy::Modules::RequireEndWithOne Perl::Critic::Policy::Modules::RequireExplicitPackage Perl::Critic::Policy::Modules::RequireBarewordIncludes (Bare comes before E[nd|xplicit]) Perl::Critic::Policy::Subroutines::ProhibitAmpersandSigils Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef Perl::Critic::Policy::Subroutines::ProhibitExcessComplexity Perl::Critic::Policy::Subroutines::ProhibitBuiltinHomonyms Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes Perl::Critic::Policy::Subroutines::ProtectPrivateSubs Perl::Critic::Policy::Subroutines::RequireFinalReturn Perl::Critic::Policy::References::ProhibitDoubleSigils Perl::Critic::Policy::RegularExpressions::RequireExtendedFormatting Perl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching (R comes before S) -Alan
On Mon Jun 12 14:27:55 2006, cubrewer@yahoo.com wrote: Show quoted text
> Nope. No ~/.perlcriticrc.
Shoot. One more wrong guess. :-) Show quoted text
> So, the error occurs in the second line of the below code block, > right? > > And the only method invocation is ->default_severity, right? Where > does the elements of @SITE_POLICIES come from? > > #Don't load policy if it is below the severity threshold > my $severity = $params->{severity} || $policy_long->default_severity; > if ( $severity < $min_severity ) { > $load_me = $FALSE; > }
The @SITE_POLICIES comes from Module::Pluggable which searches your @INC for files that match Perl/Critic/Policy/.*\.pm. So, that's what led me to ask if you had a "Variables.pm" file somewhere on your system. The Module::Pluggable behavior can be overridden by ~/.perlcriticrc, so that's why I asked about that file. Perl::Critic::Config then bombs on matches that lack a default_severity() method, either by themselves or inherited from Perl::Critic::Policy.pm. That's what's causing the test failure, but I just can't figure out where the bad policy module is coming from on your system. Show quoted text
> In native_policies() there is a comment about the list being sorted...
I will remove that comment -- it's not longer applicable. Thanks for the detailed analysis, nonetheless. I've corrected the sort order. -- Chris
Subject: Re: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install
Date: Mon, 12 Jun 2006 13:32:29 -0700 (PDT)
To: bug-Perl-Critic [...] rt.cpan.org
From: Alan Mead <cubrewer [...] yahoo.com>
All of the policies seem to have the string 'default_severity'... Can you suggest a way for me to gather additional information? -Alan Show quoted text
----- Original Message ---- From: via RT <bug-Perl-Critic@rt.cpan.org> To: cubrewer@yahoo.com Sent: Monday, June 12, 2006 1:46:24 PM Subject: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install Perl::Critic::Config then bombs on matches that lack a default_severity() method, either by themselves or inherited from Perl::Critic::Policy.pm. That's what's causing the test failure, but I just can't figure out where the bad policy module is coming from on your system.
On Mon Jun 12 16:33:44 2006, cubrewer@yahoo.com wrote: Show quoted text
> All of the policies seem to have the string 'default_severity'... Can > you suggest a way for me to gather additional information? > > -Alan
Well, I'm just making wild guesses now... Here's a few ideas: * Send us your @INC path, perhaps via: perl -le'print for @INC' * See if you actually have a Variables.pm file via: perl -le'use Perl::Critic::Policy::Variables; print "Found it"' * Get a list of all of your policies via: perl -le'use Perl::Critic::Config;print for Perl::Critic::Config->site_policies' * Send us your Module::Pluggable version via: perl -le'require Module::Pluggable;print $Module::Pluggable::VERSION' * Check if there's another version of Perl::Critic installed perl -le'require Perl::Critic;print $Perl::Critic::VERSION' Maybe something in that list will give us a hint what's up with your system. Is there anything you can think of that's unusual about Perl on your computer? I don't run Fedora, so I can't think of any other good questions to ask... --Chris
Subject: Re: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install
Date: Mon, 12 Jun 2006 14:41:04 -0700 (PDT)
To: bug-Perl-Critic [...] rt.cpan.org
From: Alan Mead <cubrewer [...] yahoo.com>
* Send us your @INC path, perhaps via: perl -le'print for @INC' [root@ugly Perl-Critic-0.16]# perl -le'print for @INC' /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl . * See if you actually have a Variables.pm file via: perl -le'use Perl::Critic::Policy::Variables; print "Found it"' [root@ugly Perl-Critic-0.16]# perl -le'use Perl::Critic::Policy::Variables; print "Found it"' Can't locate Perl/Critic/Policy/Variables.pm in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. * Get a list of all of your policies via: perl -le'use Perl::Critic::Config;print for Perl::Critic::Config->site_policies' [root@ugly Perl-Critic-0.16]# perl -le'use Perl::Critic::Config;print for Perl::Critic::Config->site_policies' Can't locate Perl/Critic/Config.pm in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/p... * Send us your Module::Pluggable version via: perl -le'require Module::Pluggable;print $Module::Pluggable::VERSION' [root@ugly Perl-Critic-0.16]# perl -le'require Module::Pluggable;print $Module::Pluggable::VERSION' 3.01 [root@ugly Perl-Critic-0.16]# cpan Module::Pluggable CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Mon, 12 Jun 2006 03:27:56 GMT Module::Pluggable is up to date (3.01). * Check if there's another version of Perl::Critic installed perl -le'require Perl::Critic;print $Perl::Critic::VERSION' [root@ugly Perl-Critic-0.16]# perl -le'require Perl::Critic;print $Perl::Critic::VERSION' Can't locate Perl/Critic.pm in @INC (@INC contains: /usr/lib/per... Maybe something in that list will give us a hint what's up with your system. Is there anything you can think of that's unusual about Perl on your computer? I don't run Fedora, so I can't think of any other good questions to ask... I don't futz with Perl itself... this should be a pretty stock install. I'm trying to install Perl::Critic on a FC4 box I have running Perl 5.8.6... -Alan
Subject: Re: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install
Date: Mon, 12 Jun 2006 14:55:15 -0700 (PDT)
To: bug-Perl-Critic [...] rt.cpan.org
From: Alan Mead <cubrewer [...] yahoo.com>
Show quoted text
>Is there anything you can think of that's unusual about Perl >on your computer? I don't run Fedora, so I can't think of any >other good questions to ask...
I get the same problem on FC4 running Perl 5.8.6 ... t/01_config...........................Can't locate object method "default_severity" via package "Perl::Critic::Policy::Variables" at /root/.cpan/build/Perl-Critic-0.16/blib/lib/Perl/Critic/Config.pm line 89. # Looks like your test died before it could output anything. t/01_config...........................dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-46 Failed 46/46 tests, 0.00% okay Can you deduce anything from that fact that all the tests run fine except for the 'config' and 'pragmas' tests which all fail utterly? If it would help to have user access to one of these machines, that could be arranged. -Alan
From: cdolan [...] cpan.org
Thanks for all the feedback! On Mon Jun 12 17:41:26 2006, cubrewer@yahoo.com wrote: Show quoted text
> * Get a list of all of your policies via: > perl -le'use Perl::Critic::Config;print for > Perl::Critic::Config->site_policies' > > [root@ugly Perl-Critic-0.16]# perl -le'use Perl::Critic::Config;print > for Perl::Critic::Config->site_policies' > Can't locate Perl/Critic/Config.pm in @INC (@INC contains: > /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/p...
Oops, that should have been perl -Ilib -le'use Perl::Critic::Config;print for Perl::Critic::Config->site_policies' I forgot the "-Ilib" to include the local "lib" subdir. -- Chris
From: cdolan [...] cpan.org
Eureka! I have reproduced the bug on a clean box. It's caused by the latest version of Module::Pluggable (v3.01) which is mistakenly including directories instead of just .pm files in the module search. I will file a bug with M::P and in the meantime, you can work around the problem by downgrading that library to v2.97. I'll try to remember to announce here when there's a fix to the M::P problem. --Chris
Subject: Re: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install
Date: Tue, 13 Jun 2006 07:56:21 -0700 (PDT)
To: bug-Perl-Critic [...] rt.cpan.org
From: Alan Mead <cubrewer [...] yahoo.com>
Cool! THanks for your persistence. -Alan Show quoted text
----- Original Message ---- From: Guest via RT <bug-Perl-Critic@rt.cpan.org> To: cubrewer@yahoo.com Sent: Tuesday, June 13, 2006 12:36:40 AM Subject: [rt.cpan.org #19836] Perl-Critic0.16 fails tests during install <URL: http://rt.cpan.org/Ticket/Display.html?id=19836 > Eureka! I have reproduced the bug on a clean box. It's caused by the latest version of Module::Pluggable (v3.01) which is mistakenly including directories instead of just .pm files in the module search. I will file a bug with M::P and in the meantime, you can work around the problem by downgrading that library to v2.97. I'll try to remember to announce here when there's a fix to the M::P problem. --Chris
From: cdolan [...] cpan.org
Final story: * The bug is caused by Module::Pluggable v3.01. All other Module::Pluggable versions are fine. * The Module::Pluggable author is working on a solution. * The next version of Perl::Critic will have a workaround (simply add "inner => 0" to the Module::Pluggable import line in Perl::Critic::Config). Jeff, could you please close this bug?
This has been resolved in Perl-Critic-0.17