Closed hakonhagland closed 3 years ago
See also this on stackoverflow.com.
I suppose there's something weird going on with MacOS perl. You can run cpanm -V
to show the install paths cpanm would try to install and look for with your current environment.
Yes, this looks strange... Here is the output:
$ cpanm -V
cpanm (App::cpanminus) version 1.7044 (/usr/local/bin/cpanm)
perl version 5.028002 (/usr/bin/perl)
%Config:
archname=darwin-thread-multi-2level
installsitelib=/Library/Perl/5.28
installsitebin=/usr/local/bin
installman1dir=/usr/share/man/man1
installman3dir=/usr/share/man/man3
sitearchexp=/Library/Perl/5.28/darwin-thread-multi-2level
sitelibexp=/Library/Perl/5.28
vendorarch=/Network/Library/Perl/5.28/darwin-thread-multi-2level
vendorlibexp=/Network/Library/Perl/5.28
archlibexp=/System/Library/Perl/5.28/darwin-thread-multi-2level
privlibexp=/System/Library/Perl/5.28
%ENV:
PERLBREW_HOME=/Users/hakonhaegland/.perlbrew
PERLBREW_PATH=/Users/hakonhaegland/perl5/perlbrew/bin
PERLBREW_ROOT=/Users/hakonhaegland/perl5/perlbrew
PERLBREW_SHELLRC_VERSION=0.88
PERLBREW_VERSION=0.88
@INC:
FatPacked::140633520029008=HASH(0x7fe7cb013d50)
/Library/Perl/5.28/darwin-thread-multi-2level
/Library/Perl/5.28
/Network/Library/Perl/5.28/darwin-thread-multi-2level
/Network/Library/Perl/5.28
/Library/Perl/Updates/5.28.2/darwin-thread-multi-2level
/Library/Perl/Updates/5.28.2
/System/Library/Perl/5.28/darwin-thread-multi-2level
/System/Library/Perl/5.28
/System/Library/Perl/Extras/5.28/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.28
I'd suspect it might be that you have perlbrew environment mixed up with the system perl, and cpanm is in /usr/local/bin. Things could go wrong with this type of environment. At least I suggest you to unset these env vars to get perlbrew out of the way.
It looks to me XML::LibXSLT comes pre installed with macOS Big Sur (confirmed locally on my Mac) so the only thing that would be weird is that the first run of your cpanm XML::LibXSLT
was trying to install it, when it doesn't need to.
Is it possible that the cpanm command was running from a different perl (i.e. /usr/local/bin/perl, or some other perl via perlbrew)?
Is it possible that the cpanm command was running from a different perl
It is very possible, but if I type
$ which cpanm
/usr/local/bin/cpanm
$ which perl
/usr/bin/perl
I can also see that cpanm
is using /usr/bin/perl
by typing
$ head -1 /usr/local/bin/cpanm
#!/usr/bin/perl
So it seems it is using the correct perl..
yeah but that's after the fact, and not sure which perl cpanm was using in your first run. If you have a cpanm log file for that run in ~/.cpanm/work
it might show which perl it was using in the log.
Actually, nevermind, you ran it with -v
and the output is already there. It doesn't exactly say which perl it was using but at least the version number looks the same.
You know, what's weird is this line:
$ sudo cpanm -v XML::LibXSLT
cpanm (App::cpanminus) 1.7044 on perl 5.028002 built for darwin-thread-multi-2level
Work directory is /Users/hakonhaegland/.cpanm/work/1623300613.61292
You have make /usr/bin/make
You have LWP 6.44
You have /usr/bin/tar: bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6
You have /usr/bin/unzip
--> Working on .
Entering /Users/hakonhaegland/perl/install-cpan-modules/XML-LibXSLT-1.99
Working on .
suggests that you ran it in a way with cpanm --installdeps .
with XML::LibXSLT in cpanfile, or something along these lines. If you actually ran cpanm -v XML::LibXSLT
, it should say Working on XML::LibXSLT
.
Did you properly paste the output as-is, or did you modify the output?
Did you properly paste the output as-is, or did you modify the output?
Yes good observation. I did paste the output from log file. I remember I first ran cpanm --installdeps .
from the XML::LibXSLT
source directory. I also thought that --installdeps
would only install the dependencies not the module itself.. Then I think I saw that it actually installed the module. Probably something happened at this point that messed things up?
OK, that explains.
cpanm --installdeps .
in XML::LibXSLT source directory would install the dependencies of the module, but not XML::LibXSLT itself. But, to get the list of dependencies, cpanm has to run perl Makefile.PL
, aka configuring the module. Because XML::LibXSLT is an XS module which needs C libraries, the configuration failed.
That's what happened. Now, because XML::LibXSLT comes installed with macOS, an actual run of cpanm XML::LibXSLT
doesn't install anything, saying it's already installed.
I'm closing this issue since I don't see a problem with how cpanm behaves here.
I am using the system perl version 5.28.2 on macOS 11.2.3 :
Observe that
cpanm -U
looks in/Library/Perl/5.28
whereascpanm
apparently installed it in/System/Library/Perl/Extras/5.28