在我的带Catalina的iMac(10.15.6(上,我安装了augeas brew包,然后安装了perl模块"配置::Augas";没有问题。在大苏尔,我没有取得同样的成功。在安装冲泡包装之后;cpanm Config::Augas";,我在构建日志中得到以下输出:
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模块不喜欢的更改。有什么想法吗?
问题是libtool中的一个错误,它导致动态库使用平面名称空间编译。这再次导致共享库libSystem.B.dylib
和libfa.1.dylib
中具有相同名称的两个符号之间的冲突。两个库都声明了一个名为hash_create()
的符号,但是Perl模块需要将该符号解析为libfa.1.dylib
,但libSystem.B.dylib
总是在libfa.1.dylib
之前加载,因此使用了错误版本的hash_create()
。
该问题以前曾遇到过,请参阅此问题。可以在这里找到进一步的解释。
由于对libtool
中错误的修复尚未作为libtool
的新版本发布,因此问题并不是简单地通过升级xcode命令行工具来解决的。相反,您可以尝试下载libaugeas源代码并从以下源代码进行编译:
$ brew uninstall augeas
$ wget http://download.augeas.net/augeas-1.12.0.tar.gz
$ cd augeas-1.12.0
$ MACOSX_DEPLOYMENT_TARGET=10.15 ./configure
$ make
$ make install
注意:通过在上面的命令中指定MACOSX_DEPLOYMENT_TARGET=10.15
,我们可以解决错误,因此不必修补configure
。
Perl模块现在应该可以安装了。
另一种解决方法是:可以对libfa.1.dylib
使用动态链接(而不是动态加载(。为了实现这一点,我将模块重写为ExtUtils:MakeMaker,而不是module::Build。接下来要使用动态链接进行安装,您可以执行以下操作:
git clone https://github.com/hakonhagland/Config-Augeas-MM.git
cd https://github.com/hakonhagland/Config-Augeas-MM.git
perl Makefile.PL
make perl
make -f Makefile.aperl inst_perl MAP_TARGET=perl
注意:最后一个命令会覆盖现有的perl二进制文件,所以要小心,请参阅此链接以获取更多信息。
现在,该模块可以成功测试和安装:
$ make test
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Augeas.bs blib/arch/auto/Config/Augeas/Augeas.bs 644
rm -f blib/arch/auto/Config/Augeas/Augeas.bundle
LD_RUN_PATH="/usr/local/lib" cc -mmacosx-version-min=11.1 -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong Augeas.o -o blib/arch/auto/Config/Augeas/Augeas.bundle
-L/usr/local/lib -laugeas
chmod 755 blib/arch/auto/Config/Augeas/Augeas.bundle
PERL_DL_NONLAZY=1 "/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Config-Augeas.t ... ok
t/Config-AugeasC.t .. ok
t/pod.t ............. skipped: Test::Pod 1.00 required for testing POD
All tests successful.
Files=3, Tests=62, 7 wallclock secs ( 0.04 usr 0.02 sys + 5.71 cusr 0.50 csys = 6.27 CPU)
Result: PASS
$ make install
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Augeas.bs blib/arch/auto/Config/Augeas/Augeas.bs 644
Manifying 1 pod document
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/darwin-2level/auto/Config/Augeas/extralibs.all
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/darwin-2level/auto/Config/Augeas/Augeas.a
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/darwin-2level/auto/Config/Augeas/extralibs.ld
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/darwin-2level/auto/Config/Augeas/Augeas.bundle
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/darwin-2level/Config/Augeas.pm
Installing /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/man/man3/Config::Augeas.3
Appending installation info to /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/darwin-2level/perllocal.pod
$ perl -MConfig::Augeas -E 'say $INC{"Config/Augeas.pm"}'
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/darwin-2level/Config/Augeas.pm