What does the command "cpan reports" do exactly?

Viewed 316

I tried to install Moose in perl 5.32.0 with the command cpan install Moose. The installation failed, with the following message:

Result: FAIL
Failed 448/478 test programs. 12/30 subtests failed.
Makefile:2047: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
  ETHER/Moose-2.2013.tar.gz
13 dependencies missing (Class::Load,Class::Load::XS,Data::OptList,Devel::OverloadInfo,Dist::CheckConflicts,Module::Runtime::Conflicts,Package::DeprecationManager,Package::Stash,Package::Stash::XS,Params::Util,Sub::Exporter,Sub::Identify,Test::CleanNamespaces); additionally test harness failed
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports ETHER/Moose-2.2013.tar.gz

I tried the command cpan reports ETHER/Moose-2.2013.tar.gz, and somehow this installed Moose correctly. What happened here? What does cpan reports do exactly? Is this the same as App::cpanreports?

2 Answers

The error message there refers to something you can do in the CPAN.pm shell, and the cpan command doesn't have anything to map to that. Even if it did, it wouldn't look the same.

cpan with no arguments puts you into the CPAN.pm shell, and it's there that you can issue commands (such as install and whatnot). For reports, you need to install LWP and CPAN::Reporter first:

% cpan LWP CPAN::Reporter
...
% cpan
cpan[1]> reports ETHER/Moose-2.2013.tar.gz
Distribution: E/ET/ETHER/Moose-2.2013.tar.gz
Fetching 'http://www.cpantesters.org/show/Moose.json'...DONE

2.2013:
 +PASS 5.28.0 on SunOS/Solaris 2.11 (i86pc-solaris-64)
 +PASS 5.28.3 on GNU/Linux 5.4.34-0-lts (x86_64-linux-thread-multi)
 +PASS 5.22.4 on GNU/Linux 5.4.0-26-generic (x86_64-linux)
 +PASS 5.26.0 on FreeBSD 12.1-release (i386-freebsd-64int)
 +PASS 5.26.0 on SunOS/Solaris 2.11 (i86pc-solaris-64)

However, it's probably easier to look on CPAN Testers to see the results for a particular module.

[You asked why using cpan reports ... instead of cpan install ... helped. This answers that. brian d foy's explains why cpan reports ... wasn't what you wanted to execute.]

It tries to install a module named reports.


The syntax for cpan is

cpan [options] <module_name> [<module_name> ...]

The operation is specified through options. The default operator is -i (install).


cpan install Moose

This command tries to install two distributions:

  • The newest one containing the module install.

    A dummy module by this name was created, so this should not produce any errors.

    Newer versions of cpan simply ignore this erroneous request.

  • The newest one containing the module Moose.

    This is currently ETHER/Moose-2.2013.tar.gz.


cpan reports ETHER/Moose-2.2013.tar.gz

This command tries to install two distributions:

  • The newest one containing the module reports.

    There's no module named reports, so that part fails.

    >(error): Could not expand [reports]. Check the module name.
    >(info): I can suggest names if you install one of Text::Levenshtein::XS, Text::Levenshtein::Damerau::XS, Text::Levenshtein, and Text::Levenshtein::Damerau::PP
    >(info): and you provide the -x option on invocation.
    >(error): Skipping reports because I couldn't find a matching namespace.
    
  • ETHER/Moose-2.2013.tar.gz


So,

cpan install Moose

is merely a bad way of writing

cpan Moose

Also,

cpan reports ETHER/Moose-2.2013.tar.gz

is merely a bad way of writing

cpan ETHER/Moose-2.2013.tar.gz

Currently, this should currently be equivalent to

cpan Moose

In other words, there's no difference between the command you claimed didn't work and the one you claimed worked.

Related