CPAN 安装失败该怎么办?

CPAN 安装失败该怎么办?

我曾多次使用 CPAN 安装 perl 模块,但幸运的是,它能够正常工作。不幸的是,今天我尝试安装 Thread::Pool,但其中一个必需的依赖项 Thread::Converyor::Monitored 未通过测试:

Test Summary Report
-------------------
t/Conveyor-Monitored02.t (Wstat: 65280 Tests: 89 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Tests out of sequence.  Found (2) but expected (4)
                Tests out of sequence.  Found (4) but expected (5)
                Tests out of sequence.  Found (5) but expected (6)
                Tests out of sequence.  Found (3) but expected (7)
                Tests out of sequence.  Found (6) but expected (8)
Displayed the first 5 of 86 TAP syntax errors.
Re-run prove with the -p option to see them all.
Files=3, Tests=258,  6 wallclock secs ( 0.07 usr  0.03 sys +  4.04 cusr  1.25 csys =  5.39 CPU)
Result: FAIL
Failed 1/3 test programs. 0/258 subtests failed.
make: *** [test_dynamic] Error 255
  ELIZABETH/Thread-Conveyor-Monitored-0.12.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports ELIZABETH/Thread-Conveyor-Monitored-0.12.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 ELIZABETH/Thread-Conveyor-Monitored-0.12.tar.gz: make_test NO

您需要采取哪些步骤才能了解安装失败的原因?我甚至不确定如何开始追踪问题所在。

答案1

根据测试报告,查看该模块,似乎几乎所有模块都失败了。

我从错误消息中猜测,测试是在不同的线程中启动的,而一些后续测试所花的时间比之前的测试要少。当它们完成时,打印测试结果的顺序是错误的,这导致了失败。

这可能只是意味着测试不好,而不是代码本身不好,你可以force install Thread::Conveyor::Monitored绕过测试。

答案2

好吧,我要做的第一件事就是尝试从源代码构建模块。很多时候,你可以在那里得到更好的错误,而且,如果没有其他事情,至少你仍然可以查看整个 make 日志(确保将其传输到文件中)。

答案3

对于像我这样不熟悉的人来说cpan,您的(失败)输出中的一条消息是:

//hint// to see the cpan-testers results for installing this module, try:
  reports ELIZABETH/Thread-Conveyor-Monitored-0.12.tar.gz

此命令可以通过cpan不带参数运行来执行,以进入控制台模式:

$ cpan

cpan shell -- CPAN exploration and modules installation (v2.11)
Enter 'h' for help.

cpan[1]>

然后在其中输入建议的命令,这可能会向您显示有关安装失败的更多解释。

相关内容