Closed pattieja1 closed 5 years ago
Sample Dockerfile to reproduce the error:
FROM centos:7
RUN yum -y install yum-utils \
openssh-clients \
epel-release \
gcc \
git \
which \
automake \
autoconf \
libtool \
make \
libxml2-devel \
gettext-devel \
freetds \
freetds-devel \
expat-devel \
openssl-devel \
pkgconfig \
gd-devel \
postgresql-devel \
libmcrypt-devel \
libtool-ltdl-devel \
gnupg \
iproute
RUN yum -y install \
perl \
perl-CPAN \
perl-App-cpanminus
RUN cpanm autodie File::Fetch App::MechaCPAN ;cat /root/.cpanm/work/*/build.log
Following the instructions I specified --force
and dropped the cat command. It installed but then when it went to build perl it failed trying to extract the tarball.
logging to '/opt/gpsi/perl/local/logs/mecha_log.20181030_144836.GU43'...
logging to '/opt/gpsi/perl/local/logs/mecha_log.20181030_144836.GU43'...
Fetching perl 5.26.3
Could not unpack archive: /opt/gpsi/perl/local/tmp/mecha_perl-5.26.3.tar.gz.20181030_144840.FBOk
Fetching perl 5.26.3
Could not find perl to configure.Inflated to "/opt/gpsi/perl/local/tmp/mecha_mecha_perl-5.26.3.tar.gz.20181030_144840.FBOk.20181030_144843.kXHQ" extracted from http://www.cpan.org/src/5.0/perl-5.26.3.tar.gz at /usr/local/share/perl5/App/MechaCPAN/Perl.pm line 99.
The command '/bin/sh -c MECHACPAN_TIMEOUT=300 mechacpan perl --threads --skip-tests 5.26' returned a non-zero code: 255
I've seen that error crop up on cpan testers, and my vague, terrible theory so far was that it was failing because it wasn't starting the script in a new process. Then I actually ran the test command in your log: perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
and lo-and-behold, the same Too Late errors appeared. I'm going to investigate those, although they may just be hiding the actual issue. In the meantime, can I get the versions of the items involved in that cpanm line? The version of Perl, cpanm, Test::More, ExtUtils::MakeMaker should be the most important things involved.
CentOS 7
cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
perl 5.16.3
cpanm (App::cpanminus) 1.7044 on perl 5.016003 built for x86_64-linux-thread-multi
Work directory is /root/.cpanm/work/1543883294.21
You have make /usr/bin/make
You have /usr/bin/curl
You have /usr/bin/tar: tar (GNU tar) 1.26
Test::More 1.302141 ExtUtils::MakeMaker 6.68
PS. Your code appears to rely on autodie
but isn't depending on it and that causes an issue when trying to install App::MechaCPAN on centos. debian appears to have the module already installed so it doesn't throw a dependency failure.
Same with File::Fetch
.
NOTE: using the perl:latest
docker image (which is Debian based), using perl 5.28.0, App::MechaCPAN installs just fine. Using the same version of cpanm.
Downgraded the perl to 5.16.3, to match the centos image (though it is a perl brew build and not debian provided perl), and App::MechaCPAN installs just fine.
This is really pointing to something with the centOS image. :)
App::MechaCPAN doesn't list autodie nor File::Fetch as a dependency because both are core modules, they should exist in every perl since 5.10.1 when autodie was introduced. (File::Fetch was introduced in 5.9.5). I know in the past RedHat (and by extension, CentOS) decided to be nice and ship a stripped down version of Perl without all the core modules.
I'm looking a little more closely tonight at the error, which is hard to see because of all the noise, but I'm not seeing where autodie is the source of the issue. It appears to be somehow related to the function inflate_archive
and failing using the system tar (because the file doesn't end in gz or bz2 it tries to use xz which fails) and Archive::Tar (which shouldn't fail in the same way). I haven't been able to replicate a failure, but I think some of that code needs cleaned up a bit more and made more intelligent. If you have any insights, I'd love to hear about them.
The other side of this, the "Too late to run INIT block" error I've tracked down to the fact that Test::Harness runs the tests with perl -w
by default, causing an excessive amount of warnings. The -w
was suppressed starting in ExtUtils::MakeMaker v6.78. I am adding that as a configure dependency going forward to suppress those warnings.
yum install perl-core
fixes all my issues. :)
App::MechaCPAN just installed and it's building perl 5.26.3 right now.
I'm going to close this ticket as a non-issue.
Thanks for your help debugging. I haven't touched RedHat in > 11 years so a lot's changed. :)
I'm trying to execute the following docker command (after installing cpanm from rpms, etc.):
RUN cpanm autodie File::Fetch App::MechaCPAN ;cat /root/.cpanm/work/*/build.log
It installs autodie, File::Fetch and any dependencies they have and then proceeds to attempt building, testing and installing App::MechaCPAN. It builds okay and then fails on the tests with the following snippet being representative of all the failures.
What do you need me to test to try and figure this out?
Thanks,