RT 158393: App::Cpan @ CPAN-2.38 fails to install on macOS
This is from https://rt.cpan.org/Ticket/Display.html?id=158393 by olaf.sulla AT btinternet.com
The installation is on macOS 15.2 Perl v5.34.3 has been installed via MacPorts. The installation failed during an update to the existing build of the module using:
cpan -I -i App::Cpan
The text of the test failure is:
t/97-process_options.t ........ 1/4
# Failed test 'No arguments calls shell branch'
# at t/97-process_options.t line 22.
# got: 'HASH(0x11c4ace50)'
# expected: '23'
# Looks like you failed 1 test of 4.
...
Test Summary Report
-------------------
t/97-process_options.t (Wstat: 256 (exited 1) Tests: 4 Failed: 1)
Failed test: 3
Non-zero exit status: 1
Files=32, Tests=626, 49 wallclock secs ( 0.05 usr 0.04 sys + 14.72 cusr 5.76 csys = 20.57 CPU)
Result: FAIL
Failed 1/32 test programs. 1/626 subtests failed.
make: *** [Makefile:1068: test_dynamic] Error 255
I will provide any additional information required.
I tried to reproduce this with the macOS vendor Perl, perl v5.40 I compiled myself, and perl v5.34.3 I compiled myself.
Can you show the output of perl -V and any environment variables starting with CPAN_? Ensure that you don't expose any secrets before you post here.
The failing test checks what happens when there are no arguments, so if arguments are sneaking in through CPAN_OPTS or something like that (which I should have localized to empty), then the wrong thing can happen.
Note that this test hasn't changed since 2017 and I haven't seen another report about this problem, so you might ignore the failure and force install it. To check this after installation, start cpan and you should end up in the CPAN.pm shell:
$ cpan
Terminal does not support AddHistory.
To fix that, maybe try> install Term::ReadLine::Perl
cpan shell -- CPAN exploration and modules installation (v2.36)
Enter 'h' for help.
cpan[1]>
Thank you for pointing out the correct location to raise an issue. I followed the "Issues" link from the main MetaCPAN link for the module which took me to RT.
OK, it looks like an error on my part.
I had forgotten that I had set CPAN_OPTS so the option '-I' would have been passed twice to CPAN as a result of the command "cpan -I -i App::Cpan".
The system Perl instance is:
% /usr/bin/perl -V
Summary of my perl5 (revision 5 version 34 subversion 1) configuration:
However, I am using the MacPorts build. The attached file "perl_build_macports.txt" contains the output of perl -V.
The only CPAN env is:
CPAN_OPTS=-I
I reset the CPAN_OPTS env and attempted an install using just "cpan App::Cpan" which worked.
The module was correctly installed to the local::lib directory (I have the the various local::lib PERL5LIB envs defined in my startup scripts).
I have updated other modules this way without issue, so App::Cpan is the first one with which I have encountered a failure to update (other than a newer version of Perl being required by some other modules).
Many thanks for your quick response.
This is related to #168, but I also need to fix the test. However, my fixes aren't being applied (#187).