Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install XML::Parser on M1 Mac with homebrew perl 5.32

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.

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.

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

Running cpan install XML::Parser gives:

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.

Any suggestions?

like image 721
jimtut Avatar asked Dec 20 '20 18:12

jimtut


1 Answers

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 has now been released.

like image 170
Leon Timmermans Avatar answered Nov 04 '22 01:11

Leon Timmermans