如何在 ActivePerl 5.8.7 上安装 Devel::Cover?

发布于 2024-09-12 20:25:44 字数 738 浏览 10 评论 0原文

cpan 失败并出现以下奇怪的错误

Error: Unable to locate installed Perl libraries or Perl source code.

It is recommended that you install perl in a standard location before
building extensions. Some precompiled versions of perl do not contain
these header files, so you cannot build extensions. In such a case,
please build and install your perl from a fresh perl distribution. It
usually solves this kind of problem.

(You get this message, because MakeMaker could not find "D:\fbl_esc_bcd_tb\tools\perl\lib\CORE\perl.h")
Running make test
  Make had some problems, maybe interrupted? Won't test
Running make install
  Make had some problems, maybe interrupted? Won't install

问题是我无法在此环境中安装新的活动 perl 版本,并且我想要覆盖的工具无法在此环境之外运行。

cpan fails with this weird error as follows

Error: Unable to locate installed Perl libraries or Perl source code.

It is recommended that you install perl in a standard location before
building extensions. Some precompiled versions of perl do not contain
these header files, so you cannot build extensions. In such a case,
please build and install your perl from a fresh perl distribution. It
usually solves this kind of problem.

(You get this message, because MakeMaker could not find "D:\fbl_esc_bcd_tb\tools\perl\lib\CORE\perl.h")
Running make test
  Make had some problems, maybe interrupted? Won't test
Running make install
  Make had some problems, maybe interrupted? Won't install

Problem is I can't install new active perl versions in this environment and the tool I want to coverage on does not run outside this environment.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光暖心i 2024-09-19 20:25:44

简短回答:ActiveState PPM 存储库 有一个预编译版本的 Devel::Cover,您应该能够安装。

长答案:这不是来自 MakeMaker 的正常消息,所以我愿意猜测它是 ActiveState 添加的内容,但这可能是真的。问题正是错误消息所说的;您的发行版缺少一些重要文件,特别是 Perl 的 C 头文件,因此它无法编译 Devel::Cover 等模块所需的 C 代码。这通常是由于过于热心的系统管理员或打包人员希望节省几十K的磁盘空间而造成的。您可能5.8 中的头文件。 7 源,将它们复制到 CORE 目录中,它可能可以工作。它不会让事情变得更糟。

我同意 Evan 的观点,假设这是一台 Windows 机器,您应该切换到 Strawberry Perl,它比 ActivePerl 更适合 Perl 社区的其他成员。

否则,ActiveState是一家商业公司,他们已经支付了Perl支持。给他们打电话。

Short answer: The ActiveState PPM repository has a precompiled version of Devel::Cover you should be able to install.

Long answer: That's not a normal message from MakeMaker so I'm willing to guess its an ActiveState addition, but its probably true. The problem is exactly what the error message says; your distribution is missing some important files, specifically the C header files for Perl, so it cannot compile C code necessary for modules like Devel::Cover. This is often the result of an overzealous sysadmin or packager looking to save a few dozen K of disk space. You could probably take the header files from the 5.8.7 source, copy them into the CORE directory and it will probably work. It won't make anything worse.

I agree with Evan that, assuming this is a Windows machine, you should switch to Strawberry Perl which plays much better with the rest of the Perl community than ActivePerl.

Otherwise, ActiveState is a commercial company and they have paid Perl support. Give them a ring.

绅刃 2024-09-19 20:25:44

Active Perl 不使用 CPAN。如果您想使用 CPAN,请使用 Strawberry Perl。 Active Perl 通过其 ppm 系统使用二进制分发。如果官方没有 Devel::Cover,则有一些第三方存储库 - 尽管官方可能有 Devel::Cover。

如今,大多数人都从 AS 搬到了 Strawberry。在我看来,它更加稳定且对 CPAN 友好,并且肯定不那么专有。另外,期望能够获得大多数内容的稳定版本 - 众所周知,AS 在官方存储库中的许多情况下都会滞后数年。 Strawberry 还附带了自己的编译器和构建环境,因此您甚至可以轻松获得 ::XS 版本。

Active Perl does not use CPAN. If you want to use CPAN use Strawberry Perl. Active Perl uses binary distribution through its ppm system. There are a few third party repos for it if the official one doesn't have Devel::Cover -- though the official probably has Devel::Cover.

Most people these days are moving to Strawberry and away from AS. In my opinion, it is far more stable and CPAN-friendly, and surely less proprietary. Also, expect to be able to get stable versions of most everything - AS has been known to lag years in many occasions in the official repos. strawberry also comes with its own compiler and build environment so you can even get ::XS versions working with ease.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文