【发布时间】:2021-06-09 13:14:36
【问题描述】:
在我的带有 Catalina (10.15.6) 的 iMac 上,我安装了 augeas brew 包,然后安装了 perl 模块“Config::Augeas”而没有问题。在大苏尔,我没有取得同样的成功。安装 brew 包然后执行“cpanm Config::Augeas”后,我在构建日志中得到以下输出:
27 Building Config-Augeas
28 cc -I/Users/me/perl5/perlbrew/perls/perl-5.32.1/lib/5.32.1/darwin-2level/CORE -DVERSION="1.000" -DXS_VERSION="1.000" -I/usr/local/Cellar/augeas/1.12.0/include -Wall -Wformat -Werror=format-security -c -fno-common -DPERL_DARWIN -mmacosx-version-min=11.2 -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -DPERL_USE_SAFE_PUTENV -O3 -o lib/Config/Augeas.o lib/Config/Augeas.c
29 ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Config/Augeas/Augeas.bs')
30 cc -mmacosx-version-min=11.2 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong -o blib/arch/auto/Config/Augeas/Augeas.bundle lib/Config/Augeas.o -L/usr/local/Cellar/augeas/1.12.0/lib -laugeas
31 Can't call method "get" on an undefined value at /Users/me/.cpanm/work/1615471944.29922/Config-Augeas-1.000/blib/lib/Config/Augeas.pm line 227.
32 # Looks like your test exited with 255 just after 2.
33 t/Config-Augeas.t ...
34 Dubious, test returned 255 (wstat 65280, 0xff00)
35 Failed 28/30 subtests
36
37 # Failed test 'Created new Augeas object without backup file'
38 # at t/Config-AugeasC.t line 76.
39 Can't call method "set" on an undefined value at t/Config-AugeasC.t line 78.
40 # Looks like your test exited with 255 just after 4.
41 t/Config-AugeasC.t ..
42 Dubious, test returned 255 (wstat 65280, 0xff00)
43 Failed 29/32 subtests
44 Can't stat config-model-edit: No such file or directory
45 at /Users/me/perl5/perlbrew/perls/perl-5.32.1/lib/site_perl/5.32.1/Test/Pod.pm line 223.
46 t/pod.t ............. ok
两台机器都在运行 perlbrew(尽管 perl 版本不同)。我认为 perl 的版本不是问题,Big Sur 更有可能做了一些 perl 模块不喜欢的更改。有什么想法吗?
【问题讨论】:
-
为了排除 perlbrew 的任何问题,我在较旧的 Mac 上进行了 Big Sur 的全新安装,并尝试在不使用 perlbrew 的情况下安装并遇到了同样的问题。
-
是的,我也可以在这里看到问题(macOS 11.2,perlbrew perl 5.32)。我可以看到测试t/Config-Augeas.t 失败。似乎问题出在line 39 它在line 116 in Config/Augeas.pm 处调用
new()... -
... 在line 142 它调用XS 文件Augeas.xs at line 86 中的
aug_init()。这个函数似乎返回一个未定义的值。我正在调查可能是什么问题。 -
如果我直接从 C 调用
aug_init()它可以工作(它不返回 NULL)。我用this测试程序,用cc `pkg-config --cflags augeas` `pkg-config --libs augeas` -o anew anew.c编译。所以我的猜测是,问题与 perl 在运行时加载共享库libaugeas.dylib(间接通过 perl 生成的 Augeas.bundle)有关,而测试 C 程序是用静态库libaugeas.a编译的...我是进一步调查 -
这个补丁有更多细节:github.com/ziglang/zig/pull/6932