无法在带有自制软件Perl

无法在带有自制软件Perl

本文介绍了无法在带有自制软件Perl 5.32的M1 Mac上安装XML :: Parser的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的新的基于M1的Mac具有Apple的内置Perl版本v5.28.2.我使用自制软件安装了最新的perl 5.32.0,并配置了local :: lib选项,以便将cpan模块安装在〜/perl5中.所有这些在大多数情况下都是有效的.

My new M1-based Mac has Apple's built-in Perl version, v5.28.2. I used homebrew to install the latest perl, 5.32.0, and I configured the local::lib option so that cpan modules would get installed in ~/perl5. All of that works for the most part.

但是...我无法在此Homebrew/local-lib配置中安装XML:Parser.我认为XML :: Parser已安装在Apple的基本配置中,但我确实希望能够更新Perl并安装模块,因此我认为此配置是正确的方法.但是很多东西都需要XML :: Parser.

But... I cannot install XML:Parser in this homebrew/local-lib configuration. I think XML::Parser is installed in Apple's base config, but I really want to be able to update Perl and install modules, so I think this config is the right way to do that. But a LOT of stuff requires XML::Parser.

这是我的环境变量,PATH等:

Here are my environment variables, PATH, etc:

PERL5LIB=/Users/jim/perl5/lib/perl5
PERL_LOCAL_LIB_ROOT=/Users/jim/perl5
PERL_MB_OPT=--install_base "/Users/jim/perl5"
PERL_MM_OPT=INSTALL_BASE=/Users/jim/perl5

PATH=/Users/jim/perl5/bin:.:/Users/jim/Documents/scripts:/opt/homebrew/bin:/Developer/usr/bin:/System/Library/Frameworks/Python.framework/Versions/Current/bin:/Users/jim/Library/Python/2.7/bin:/Users/jim/perl5/bin:/Users/jim/go/bin:/Users/jim/.cargo/bin:/usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11/bin

% /usr/bin/which -a perl
/opt/homebrew/bin/perl
/usr/bin/perl

% /usr/bin/which -a cpan
/Users/jim/perl5/bin/cpan
/opt/homebrew/bin/cpan
/Users/jim/perl5/bin/cpan
/usr/bin/cpan

运行 cpan install XML :: Parser 会给出:

Running make test for TODDR/XML-Parser-2.46.tar.gz
"/opt/homebrew/Cellar/perl/5.32.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Expat.bs ../blib/arch/auto/XML/Parser/Expat/Expat.bs 644
Manifying 1 pod document
PERL_DL_NONLAZY=1 "/opt/homebrew/Cellar/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/astress.t ........... 1/27
    Can't load '/Users/jim/.cpan/build/XML-Parser-2.46-0/blib/arch/auto
    /XML/Parser/Expat/Expat.bundle' for module XML::Parser::Expat:
    dlopen(/Users/jim/.cpan/build/XML-Parser-2.46-0/blib/arch/auto
    /XML/Parser/Expat/Expat.bundle, 2): Symbol not found: _XML_DefaultCurrent
  Referenced from: /Users/jim/.cpan/build/XML-Parser-2.46-0/blib/arch/auto/XML/Parser/Expat/Expat.bundle
  Expected in: flat namespace
 in /Users/jim/.cpan/build/XML-Parser-2.46-0/blib/arch/auto/XML/Parser/Expat/Expat.bundle at /opt/homebrew/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level/DynaLoader.pm line 197.
 at /Users/jim/.cpan/build/XML-Parser-2.46-0/blib/lib/XML/Parser.pm line 18.
Compilation failed in require at /Users/jim/.cpan/build/XML-Parser-2.46-0/blib/lib/XML/Parser.pm line 18.
BEGIN failed--compilation aborted at /Users/jim/.cpan/build/XML-Parser-2.46-0/blib/lib/XML/Parser.pm line 22.
Compilation failed in require at t/astress.t line 11.
BEGIN failed--compilation aborted at t/astress.t line 11.
t/astress.t ........... Dubious, test returned 2 (wstat 512, 0x200)
Failed 27/27 subtests

(在错误消息中添加了换行符以使其易于阅读.)

(Line breaks added to error message to make it readable.)

在那之后还有更多的测试失败,但是我认为这是问题的根源.

There are more test failures after that, but that's the root of the problem there, I think.

有什么建议吗?

推荐答案

安装ExtUtils :: MakeMaker (7.57_02)应该可以解决您的问题.它可能很快就会以稳定版本的形式发布.

Installing the latest beta release of ExtUtils::MakeMaker (7.57_02) should solve your problem. It will probably be released as a stable release soon.

ETA:现已发布7.58.

ETA: 7.58 has now been released.

这篇关于无法在带有自制软件Perl 5.32的M1 Mac上安装XML :: Parser的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 22:51