4

I tried to download, unpack, follow instructions:

  tar -zxf Perl-Critic-1.107_001.tar.gz
    cd Perl-Critic-1.107_001
    perl Makefile.PL
    make
    make test
    make install

When I get to the make step I get:

/usr/bin/perl "-Iblib/arch" "-Iblib/lib" t/Variables/RequireLocalizedPunctuationVars.run.PL t/Variables/RequireLocalizedPunctuationVars.run
Can't locate B/Keywords.pm in @INC (@INC contains: blib/arch blib/lib /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at t/Variables/RequireLocalizedPunctuationVars.run.PL line 16.
BEGIN failed--compilation aborted at t/Variables/RequireLocalizedPunctuationVars.run.PL line 16.
make: *** [t/Variables/RequireLocalizedPunctuationVars.run] Error 2

I suspect its because I am missing a dependency. I also found this task - https://metacpan.org/pod/Task::Perl::Critic which seems interesting but it has no directions on how to run.

--- EDIT After running - sudo cpan Task::Perl::Critic

I get these results:

Test Summary Report
-------------------
t/20_policies.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/pod.t         (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=5, Tests=5,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.08 cusr  0.01 csys =  0.12 CPU)
Result: FAIL
Failed 2/5 test programs. 0/5 subtests failed.
make: *** [test_dynamic] Error 255
  MARCELO/Perl-Critic-Itch-0.07.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports MARCELO/Perl-Critic-Itch-0.07.tar.gz
Running make install
  make test had returned bad status, won't install without force
Running Build for T/TH/THALJEF/Task-Perl-Critic-1.008.tar.gz
  Has already been unwrapped into directory /Users/joelnylund/.cpan/build/Task-Perl-Critic-1.008-g5bmDk

  CPAN.pm: Going to build T/TH/THALJEF/Task-Perl-Critic-1.008.tar.gz

Warning: Prerequisite 'Perl::Critic::PetPeeves::JTRAMMELL => 0.01' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'JTRAMMELL/Perl-Critic-PetPeeves-JTRAMMELL-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Dynamic => 0.05' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Perl-Critic-Dynamic-0.05.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Test::Perl::Critic::Progressive => 0.03' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Test-Perl-Critic-Progressive-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Compatibility => 1.000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-Compatibility-1.001.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Swift => 1.000003' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-Swift-v1.0.3.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Lax => 0.007' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'RJBS/Perl-Critic-Lax-0.009.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Bangs => 1.00' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'PETDANCE/Perl-Critic-Bangs-1.10.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::More => 1.000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'ELLIOTJS/Perl-Critic-More-1.000.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Tics => 0.005' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'RJBS/Perl-Critic-Tics-0.007.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic => 1.117' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Perl-Critic-1.118.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Pulp => 3' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'KRYDE/Perl-Critic-Pulp-80.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Storable => 0' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'MATTD/Perl-Critic-Storable-0.01.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Test::Perl::Critic => 1.02' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/Test-Perl-Critic-1.02.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'criticism => 1.02' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/criticism/criticism-1.02.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::StricterSubs => 0.03' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'THALJEF/strictersubs/Perl-Critic-StricterSubs-0.03.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Nits => 1.000000' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'KCOWGILL/Perl-Critic-Nits-v1.0.0.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Warning: Prerequisite 'Perl::Critic::Itch => 0' for 'THALJEF/Task-Perl-Critic-1.008.tar.gz' failed when processing 'MARCELO/Perl-Critic-Itch-0.07.tar.gz' with 'make_test => NO'. Continuing, but chances to succeed are limited.
Building Task-Perl-Critic
  THALJEF/Task-Perl-Critic-1.008.tar.gz
  ./Build -- OK
Running Build test
t/00_load.t .......... 1/1 # Testing Task::Perl::Critic 1.008
t/00_load.t .......... ok   
t/98_pod_syntax.t .... ok   
t/99_pod_coverage.t .. skipped: Test::Pod::Coverage 1.00 requried to test POD
All tests successful.
Files=3, Tests=2,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.07 cusr  0.02 csys =  0.12 CPU)
Result: PASS
  THALJEF/Task-Perl-Critic-1.008.tar.gz
Tests succeeded but 18 dependencies missing (Perl::Critic::Storable,Perl::Critic::PetPeeves::JTRAMMELL,Perl::Critic::Dynamic,Test::Perl::Critic::Progressive,Test::Perl::Critic,Perl::Critic::Compatibility,Perl::Critic::Swift,Perl::Critic::Moose,Perl::Critic::Lax,criticism,Perl::Critic::Bangs,Perl::Critic::More,Perl::Critic::StricterSubs,Perl::Critic::Tics,Perl::Critic::Nits,Perl::Critic,Perl::Critic::Pulp,Perl::Critic::Itch)
  THALJEF/Task-Perl-Critic-1.008.tar.gz
  [dependencies] -- NA
Running Build install
  make test had returned bad status, won't install without force
szabgab
  • 6,202
  • 11
  • 50
  • 64
Joelio
  • 4,621
  • 6
  • 44
  • 80
  • 4
    Use the `cpan` command line program to do automated installation, which also install dependencies: `sudo cpan Task::Perl::Critic` – amon Sep 23 '13 at 12:18
  • 1
    Didn't you try using the CPAN shell? `perl -MCPAN -e shell`; followed by `install Perl::Critic`. It'll handle dependencies for you. – devnull Sep 23 '13 at 12:18
  • Tried (sudo cpan Task::Perl::Criti) that now, it did a lot of work, but ended with : Running Build install make test had returned bad status, won't install without force – Joelio Sep 23 '13 at 12:50
  • Then try to use --force :-) – user1126070 Sep 23 '13 at 13:34
  • 2
    The "won't install without force" means a test failed. Forcing it without understanding why the test fails is counterproductive, because you don't know that the install program will work. We would need to see the test failures to be able to continue to help you solve this. – Andy Lester Sep 23 '13 at 13:44
  • 2
    @user1126070: Blindly force installing is terrible advice. You have no idea what the status of the build is. OP could be installing broken code and not know it. – Andy Lester Sep 23 '13 at 13:45
  • 1
    Why are you trying to install a three-year old version of Perl::Critic, why not the newest 1.118? – Slaven Rezic Sep 23 '13 at 16:35
  • @Slaven - I installed the latest from the website -Perl-Critic-1.118 - my guess is the install readme is justold – Joelio Sep 28 '13 at 11:45

3 Answers3

12

You probably don't want to install Task::Perl::Critic. It includes a bunch of plugins with additional policies that are written by other authors. Some of them will conflict with each other (i.e. complying with one means violating another). And according to the error messages you showed above, these plugins are the source of the test failures, not Perl::Critic itself.

Installing Perl::Critic alone should be a sufficient. As others have suggested, use the cpan utility:

sudo cpan Perl::Critic

That will take care of all the dependencies for you.

0

You might want to take care of your Perl installation first.

On Big Sur I noticed a missing keywords.h, hence the force install B::Keywords.

This worked for me:

    # cpan
    install CPAN
    reload cpan
    install Term::ReadLine::Perl
    install Log::Log4perl
    upgrade
    force install B::Keywords
    install Perl::Critic
bbaassssiiee
  • 6,013
  • 2
  • 42
  • 55
-4

Well, it seems the terrible advice was the only one that worked, from comments I did:

 cpan
 force install Task::Perl::Critic

And it seems to work so far.. I have reviewed about a dozen perl files and the results seem to be what I was looking for...

Joelio
  • 4,621
  • 6
  • 44
  • 80
  • 1
    That works except for the part where you've forced it to install even though you don't have the dependencies installed. Do you think that everything is going to magically work without having those dependencies installed? **The reason there are tests is so that you have some reason to think that the code will work.** You are ignoring that, and when you run into failures down the road, you're going to have that "force install" to blame. – Andy Lester Oct 03 '13 at 15:19
  • Hi Andy, you haven't offered any solution, this makes the tool work and I agree there is some timebomb somewhere, but I don't have anther alternative to try. I updated the tickets with the output of install. – Joelio Oct 04 '13 at 18:16
  • The solution is to try to install Task::Perl::Critic, and when that fails, show us the error message from the part that fails so that we can help you diagnose it. You have not shown us any error messages. That install is going to install many modules, and one of them failed, but you haven't showed us which one of them failed, or what error message you got when it failed. – Andy Lester Oct 04 '13 at 18:39
  • all of the output from the install is in the item above – Joelio Oct 04 '13 at 18:40