在 Big Sur 上使用 perlbrew 安装 perl 时出错

Error installing perl using perlbrew on Big Sur

我正在尝试使用 perlbrew 在我的 macOS 环境中安装 perl 版本 5.33.4。我无法理解为什么在安装过程中会失败。

我开始使用 \curl -L https://install.perlbrew.pl | bash 安装 perlbrew,然后我在我的 zshenv 中添加了这一行:source ~/perl5/perlbrew/etc/bashrc 并开始使用 perlbrew install perl-5.33.4 命令安装 perl。 我也尝试过不同的 perl 版本,但问题是一样的。

这是记录的错误:

# Failed test 20 - array should contain one result or more: libc => () at t/DynaLoader.t line 127
#      got "0"
# expected >= "1"
../ext/DynaLoader/t/DynaLoader.t ..................................... 
Failed 1/44 subtests 


Test Summary Report
-------------------
../ext/DynaLoader/t/DynaLoader.t                                   (Wstat: 0 Tests: 44 Failed: 1)
  Failed test:  20
Files=2652, Tests=1183275, 624 wallclock secs (25.86 usr  5.24 sys + 260.60 cusr 25.43 csys = 317.13 CPU)
Result: FAIL
make: *** [test_harness] Error 1
##### Brew Failed #####

我怎样才能找到检测问题并解决问题的方法? 提前感谢任何建议。

这是 perl 需要修复的问题。有 perlbrew issue 701 that's related to how MakeMaker looks for libraries.

macOS Big Sur 的一项更改破坏了 Perl 模块安装工具链的一部分。

来自macOS Big Sur 11.0.1 Release Notes

New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)

这会阻止安装 Perl。

已针对 ExtUtils-MakeMaker here 提交了工单 (#381)。目前尚未解决。

针对 Perl 本身提出的工单 (#18406) here