简体   繁体   English

Perl LibXLST 在 Mac OS Big Sur 11.4 上失败

[英]Perl LibXLST failing on Mac OS Big Sur 11.4

I'm having trouble with a Perl application that fails with an LibXSLT-related error on Mac OS Big Sur 11.4 on multiple computers (all Intel Macs) - it worked correctly before the Mac OS upgrade, and now seems to fail on a freshly installed up-to date Mac.我在使用 Perl 应用程序时遇到问题,该应用程序在多台计算机(所有英特尔 Mac)上的 Mac OS Big Sur 11.4 上出现与 LibXSLT 相关的错误而失败 - 它在 Mac OS 升级之前工作正常,现在似乎在新安装的设备上失败最新的 Mac。

The error message for a minimal script perl -MXML::LibXSLT -E 'say $INC{"XML/LibXSLT.pm"}' (using system perl - no other perl is installed on the machine) is as follows:最小脚本perl -MXML::LibXSLT -E 'say $INC{"XML/LibXSLT.pm"}'的错误消息(使用系统 perl - 机器上没有安装其他 ZF83A0AA1F9CA0F7DD5994445Z7)

Can't load '/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle' for module XML::LibXSLT: dlopen(/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle, 0x0001): symbol '_xsltLibxsltVersion' not found, expected in flat namespace by '/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle' at /System/Library/Perl/5.30/darwin-thread-multi-2level/DynaLoader.pm line 197. at /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/XML/LibXSLT.pm line 48. BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/XML/LibXSLT.pm line 48. Compilation failed in require.无法加载模块 XML::LibXSLT: dlopen(/System/Library/Perl/) 的“/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle” Extras/5.30/darwin-thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle, 0x0001): 未找到符号 '_xsltLibxsltVersion',预计在平面命名空间中由 '/System/Library/Perl/Extras/5.30/darwin -thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle' 在 /System/Library/Perl/5.30/darwin-thread-multi-2level/DynaLoader.pm 第 197 行。在 /System/Library/Perl/Extras /5.30/darwin-thread-multi-2level/XML/LibXSLT.pm 第 48 行。开始失败 - 编译在 /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/XML/LibXSLT.pm 中止第 48 行。在 require 中编译失败。 BEGIN failed--compilation aborted. BEGIN 失败——编译中止。

cpan -i XML::LibXSLT confirms that XML::LibXSLT is up to date (1.99). cpan -i XML::LibXSLT确认XML::LibXSLT is up to date (1.99).

I tried updating the xslt libraries with brew install libxslt but it did not seem to make any difference.我尝试使用brew install libxslt更新 xslt 库,但似乎没有任何区别。

I've tried running brew link libxslt --force , which now does not do anything ( Warning: Refusing to link macOS provided/shadowed software: libxslt ).我试过运行brew link libxslt --force ,它现在什么都不做( Warning: Refusing to link macOS provided/shadowed software: libxslt )。

Running cpan -f -t XML::LibXSLT fails with the following error message:运行cpan -f -t XML::LibXSLT失败并显示以下错误消息:

looking for -lxslt... no
libxslt not found
Try setting LIBS and INC values on the command line

If I set the LIBS and INC values to the path suggested by brew export LIBS="-L/usr/local/opt/libxslt/lib" and export INC="-I/usr/local/opt/libxslt/include" , it still fails with this error.如果我将 LIBS 和 INC 值设置为 brew export LIBS="-L/usr/local/opt/libxslt/lib"export INC="-I/usr/local/opt/libxslt/include"建议的路径,它仍然因此错误而失败。

Any suggestions on how to debug this?关于如何调试这个的任何建议? I'm not a Perl developer, just trying to run an existing app.我不是 Perl 开发人员,只是想运行现有的应用程序。

Perlbrew Perlbrew

Eventually, I succeeded with perlbrew instead of the default OS X system perl.最终,我成功使用 perlbrew 而不是默认的 OS X 系统 perl。

The following process worked, based on recommendations at https://perlbrew.pl :根据https://perlbrew.pl的建议,以下过程有效:

curl -L https://install.perlbrew.pl | bash   
source ~/perl5/perlbrew/etc/bashrc
perlbrew install perl-5.16.0   
perlbrew switch perl-5.16.0
sudo cpan -i XML::LibXSLT

I consider it not as a proper solution but as a workaround - after all, there's no reason why the OS X preinstalled libxslt shouldn't just work with the preinstalled system perl - but it at least works.我认为它不是一个合适的解决方案,而是一种解决方法——毕竟,OS X 预装的 libxslt 没有理由不应该只与预装的系统 perl 一起工作——但它至少可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM