Subject: | CPAN is broken on older perls |
Somewhere between 2.10 and 2.12, CPAN acquired the following line of code:
my $eexist = $CPAN::META->has_usable("Errno") ? &Errno::EEXIST : undef;
It fails badly on older perls (pre-5.20) with the following:
/tmp/eiH8ohY/bin/perl -Iblib/lib/ -Iblib/arch t/97-return_values.t
1..10
ok 1 - blib/script/cpan is there
ok 2 - blib/script/cpan compiles
ok 3 - Config file exists
ok 4 - Config file compiles
# Command is [/tmp/eiH8ohY/bin/perl -Mblib blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm -J 1>/dev/null 2>&1 ]
ok 5 - blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm -J
# Command is [/tmp/eiH8ohY/bin/perl -Mblib blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Prereq::Fails 1>/dev/null 2>&1 ]
not ok 6 - blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Prereq::Fails
# Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Prereq::Fails'
# at t/97-return_values.t line 49.
# got: '2'
# expected: '1'
# Command is [/tmp/eiH8ohY/bin/perl -Mblib blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Make::Fails 1>/dev/null 2>&1 ]
not ok 7 - blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Make::Fails
# Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Make::Fails'
# at t/97-return_values.t line 49.
# got: '2'
# expected: '1'
# Command is [/tmp/eiH8ohY/bin/perl -Mblib blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Test::Fails 1>/dev/null 2>&1 ]
not ok 8 - blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Test::Fails
# Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Test::Fails'
# at t/97-return_values.t line 49.
# got: '2'
# expected: '1'
# Command is [/tmp/eiH8ohY/bin/perl -Mblib blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Unsupported::OS 1>/dev/null 2>&1 ]
not ok 9 - blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Unsupported::OS
# Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Unsupported::OS'
# at t/97-return_values.t line 49.
# got: '2'
# expected: '1'
# Command is [/tmp/eiH8ohY/bin/perl -Mblib blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Works::Fine 1>/dev/null 2>&1 ]
not ok 10 - blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Works::Fine
# Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Works::Fine'
# at t/97-return_values.t line 49.
# got: '2'
# expected: '0'
# Looks like you failed 5 tests of 10.
And now running separate command from this test:
/tmp/eiH8ohY/bin/perl -Mblib blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Works::Fine
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: Storable loaded ok (v2.41)
Reading '/tmp/CPAN-2.12-TRIAL/cpan-home/Metadata'
Warning: Found only 11 objects in /tmp/CPAN-2.12-TRIAL/cpan-home/Metadata
CPAN: Time::HiRes loaded ok (v1.9725)
Reading '/tmp/CPAN-2.12-TRIAL/t/97-cpan1-test-mirror/authors/01mailrc.txt.gz'
CPAN: Compress::Zlib loaded ok (v2.06)
............................................................................DONE
Reading '/tmp/CPAN-2.12-TRIAL/t/97-cpan1-test-mirror/modules/02packages.details.txt'
Database was generated on Tue, 27 Jan 2009 19:26:52 GMT
HTTP::Date not available
Warning: This index file is 3326 days old.
Please check the host you chose as your CPAN mirror for staleness.
I'll continue but problems seem likely to happen.
............................................................................DONE
Reading '/tmp/CPAN-2.12-TRIAL/t/97-cpan1-test-mirror/modules/03modlist.data.gz'
DONE
Writing /tmp/CPAN-2.12-TRIAL/cpan-home/Metadata
Running install for module 'Local::Works::Fine'
CPAN: Digest::SHA loaded ok (v5.84)
Checksum for /tmp/CPAN-2.12-TRIAL/t/97-cpan1-test-mirror/authors/id/B/BU/BUSTER/Local-Works-Fine.tgz ok
CPAN: Archive::Tar loaded ok (v1.90)
Local-Works-Fine/
Local-Works-Fine/.gitignore
Local-Works-Fine/.releaserc
Local-Works-Fine/lib/
Local-Works-Fine/Makefile.PL
Local-Works-Fine/MANIFEST
Local-Works-Fine/MANIFEST.SKIP
Local-Works-Fine/t/
Local-Works-Fine/t/load.t
Local-Works-Fine/lib/Fine.pm
Undefined subroutine &Errno::EEXIST called at /tmp/CPAN-2.12-TRIAL/blib/lib/CPAN/Distribution.pm line 556.
Note that Errno specially discourages such usage - "Importing a particular constant may not be very portable, because the import will fail on platforms that do not have that constant. A more portable way to set $! to a valid value is to use: if (exists &Errno::EFOO)".
perl -V:
Summary of my perl5 (revision 5 version 18 subversion 0) configuration:
Platform:
osname=linux, osvers=4.9.0-3-amd64, archname=x86_64-linux
uname='linux dev.crazypanda.ru 4.9.0-3-amd64 #1 smp debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 gnulinux '
config_args='-Dman1dir=none -Dman3dir=none'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='6.3.0 20170516', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib /lib64 /usr/lib64
libs=-lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.24'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL
USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
USE_LOCALE_COLLATE USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
Built under linux
Compiled at Mar 8 2018 19:54:15
%ENV:
PERLBREW_BASHRC_VERSION="0.71"
PERLBREW_HOME="/home/s.aleinikov/.perlbrew"
PERLBREW_MANPATH="/home/s.aleinikov/perlbrew/perls/perl-5.18.0/man"
PERLBREW_PATH="/home/s.aleinikov/perlbrew/bin:/home/s.aleinikov/perlbrew/perls/perl-5.18.0/bin"
PERLBREW_PERL="perl-5.18.0"
PERLBREW_ROOT="/home/s.aleinikov/perlbrew"
PERLBREW_VERSION="0.71"
@INC:
/tmp/eiH8ohY/lib/perl5/site_perl/5.18.0/x86_64-linux
/tmp/eiH8ohY/lib/perl5/site_perl/5.18.0
/tmp/eiH8ohY/lib/perl5/5.18.0/x86_64-linux
/tmp/eiH8ohY/lib/perl5/5.18.0