Install of ExtUtils::MakeMaker in local::lib fails on fresh perl 5.8.8 install #311

Closed
haarg opened this Issue Sep 2, 2013 · 14 comments

Projects

None yet

2 participants

@haarg
Contributor
haarg commented Sep 2, 2013

perl 5.8's versions of ExtUtils::MakeMaker and ExtUtils::Install is too old to support local::lib, so cpanm automatically tries to upgrade them. However, Module::Build is also not available. Even though cpanm has a special case for ExtUtils::Install to always build with EUMM, it treats it as having a configure prerequisite of Module::Build, because a Build.PL file exists.

So cpanm will try to install Module::Build, but it will fail because ExtUtils::MakeMaker hasn't been upgraded yet, and its prereqs will fail. Additionally, it will try to install ExtUtils::Install before ExtUtils::MakeMaker has been upgraded.

To fix this, I think two changes are needed. First, adding Module::Build as a configure dependency should be special cased for ExtUtils::Install, just like it special cases picking EUMM over MB for the actual build.

Second, EUMM and EUI probably shouldn't be forced as prerequisites when one of them is requested to be installed. Or at least, it shouldn't end up putting EUI first.

To reproduce this, make a fresh install of perl 5.8.8 and ensure it is write protected. Then run:
cpanm -l ~/local-libs/5.8-test ExtUtils::MakeMaker@6.72
6.72 is needed because the latest version of EUMM is currently broken on perl 5.8.

@miyagawa
Owner
miyagawa commented Sep 2, 2013

I just installed fresh 5.8.8, but couldn't reproduce the error with EUMM 6.72 specifically - it installed cleanly.

However installing cpanm itself with plenv install-cpanm failed, because the EUMM latest failed like you said.

@miyagawa
Owner
miyagawa commented Sep 2, 2013
PLENV_VERSION=5.8.8 plenv install-cpanm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  261k  100  261k    0     0   128k      0  0:00:02  0:00:02 --:--:--  419k
! Installing ExtUtils::MakeMaker failed. See /Users/miyagawa/.cpanm/work/1378161314.77971/build.log for details. Retry with --force to force install it.
Successfully installed parent-0.227
Successfully installed version-0.9903
Successfully installed Module-Metadata-1.000016
Successfully installed CPAN-Meta-YAML-0.008
Successfully installed JSON-PP-2.27202Successfully installed Parse-CPAN-Meta-1.4405Successfully installed Test-Simple-0.98 (upgraded from 0.62)Successfully installed CPAN-Meta-Requirements-2.123Successfully installed File-Path-2.09 (upgraded from 1.08)Successfully installed File-Temp-0.2301 (upgraded from 0.16)
Successfully installed CPAN-Meta-2.132140
Successfully installed Capture-Tiny-0.22
Successfully installed Perl-OSType-1.004
Successfully installed PathTools-3.40 (upgraded from 3.12)
Successfully installed Locale-Maketext-Simple-0.21
Successfully installed Module-Load-0.24
Successfully installed Module-CoreList-2.97
Successfully installed Params-Check-0.38
Successfully installed Module-Load-Conditional-0.58
Successfully installed IPC-Cmd-0.84
Successfully installed ExtUtils-CBuilder-0.280205Successfully installed Test-Harness-3.28 (upgraded from 2.56)
! Installing the dependencies failed: Installed version (6.30) of ExtUtils::MakeMaker is not in range '6.46'
! Bailing out the installation for ExtUtils-ParseXS-3.22.
Successfully installed Pod-Escapes-1.04
Successfully installed Pod-Simple-3.28
Successfully installed podlators-2.5.1 (upgraded from 1.37)
! Installing the dependencies failed: Module 'ExtUtils::ParseXS' is not installed
! Bailing out the installation for Module-Build-0.4007.
Successfully installed ExtUtils-Install-1.54 (upgraded from 1.33)
! Installing the dependencies failed: Installed version (6.30) of ExtUtils::MakeMaker is not in range '6.31', Module 'Module::Build' is not installed  
! Bailing out the installation for App-cpanminus-1.6942.
26 distributions installed
@haarg
Contributor
haarg commented Sep 2, 2013

Was your perl 5.8 build write protected? If it isn't write protected, the old version of EUMM will build all the modules, but install them in the wrong place.

@miyagawa
Owner
miyagawa commented Sep 2, 2013

it isn't write protected, no.

@miyagawa
Owner
miyagawa commented Sep 3, 2013

Am I assuming right that the EUMM issue with 5.8 is known and being worked
on?

Tatsuhiko Miyagawa

@haarg
Contributor
haarg commented Sep 3, 2013

Yes, it's already fixed in the dev releases.

@miyagawa
Owner
miyagawa commented Sep 4, 2013

i will revisit once EUMM is fixed. I know it's irrelevant, but it's not
worth fixing when bootstrapping Module::Build on 5.8 will fail in any way.

On Tue, Sep 3, 2013 at 9:49 AM, Graham Knop notifications@github.comwrote:

Yes, it's already fixed in the dev releases.


Reply to this email directly or view it on GitHubhttps://github.com/miyagawa/cpanminus/issues/311#issuecomment-23727727
.

Tatsuhiko Miyagawa

@miyagawa
Owner
miyagawa commented Sep 7, 2013

now that EUMM is fixed, i just installed 5.8.8 and bootstrapped cpanm install:

> PLENV_VERSION=5.8.8 plenv install-cpanm
Successfully installed ExtUtils-MakeMaker-6.76 (upgraded from 6.30)
Successfully installed Module-Metadata-1.000016
Successfully installed Perl-OSType-1.004
Successfully installed PathTools-3.40 (upgraded from 3.12)
Successfully installed Locale-Maketext-Simple-0.21
Successfully installed Module-Load-0.24
Successfully installed Module-CoreList-2.97
Successfully installed Params-Check-0.38
Successfully installed Module-Load-Conditional-0.58
Successfully installed IPC-Cmd-0.84
Successfully installed ExtUtils-CBuilder-0.280210
Successfully installed Test-Harness-3.28 (upgraded from 2.56)
Successfully installed ExtUtils-ParseXS-3.22
Successfully installed Pod-Escapes-1.04
Successfully installed Pod-Simple-3.28
Successfully installed podlators-2.5.1 (upgraded from 1.37)
Successfully installed Module-Build-0.4007
ExtUtils::Install is up to date. (1.54)
Successfully installed App-cpanminus-1.7000
18 distributions installed

So it seems to be working.

I'm puzzled with ExtUtils::Install is up to date. (1.54) though - seems like it's installed as part of MakeMaker's bundle.

@haarg
Contributor
haarg commented Sep 7, 2013

I'm not familiar with the specifics of plenv or how it deals with installing cpanm.

The issue I'm seeing is specifically relating to installing ExtUtils::MakeMaker, using the standalone cpanm script.

When cpanm is told to install any module in a local::lib, either by environment, parameter, or not having permission to the perl library directory, it requires ExtUtils::MakeMaker be up to date enough to handle local::lib. If it isn't it will first install ExtUtils::MakeMaker, then ExtUtils::Install.

However, if the module you try to install is ExtUtils::MakeMaker, it changes the order that it tries to install. It will try to install ExtUtils::Install first. This causes two issues. First is that the EU:I install won't work correctly without the up to date EUMM. Second is that even though cpanm is hard coded to always use EUMM when installing EU:I, it still adds Module::Build as a configure prereq because a Build.PL file exists. And because EUMM hasn't been updated, many of Module::Build's prerequisites will fail to install properly.

If your perl install is not read only, the old version of EUMM will still be able to install the modules. However, they will be installed into the perl lib directories, not the local::lib directories.

@miyagawa
Owner
miyagawa commented Sep 7, 2013

plenv install-cpanm is just curl -L cpanmin.us | perl - App::cpanminus.

@miyagawa
Owner
miyagawa commented Sep 7, 2013

Note:

➜  ~  PERL_CPANM_OPT='' PLENV_VERSION=5.8.8 perl ~/dev/cpanminus/cpanm -l /tmp/adadada ExtUtils::MakeMaker
==> Found dependencies: ExtUtils::MakeMaker, ExtUtils::Install
--> Working on ExtUtils::Install
Fetching http://www.cpan.org/authors/id/Y/YV/YVES/ExtUtils-Install-1.54.tar.gz ... OK
==> Found dependencies: Module::Build
--> Working on Module::Build
Fetching http://www.cpan.org/authors/id/L/LE/LEONT/Module-Build-0.4007.tar.gz ... OK
==> Found dependencies: Module::Build
Configuring Module-Build-0.4007 ... OK
==> Found dependencies: Module::Metadata, CPAN::Meta, Perl::OSType, ExtUtils::CBuilder, Parse::CPAN::Meta, Test::Harness, ExtUtils::ParseXS, version, Pod::Man, CPAN::Meta::YAML
--> Working on Module::Metadata
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Module-Metadata-1.000016.tar.gz ... OK
Configuring Module-Metadata-1.000016 ... OK
==> Found dependencies: version
--> Working on version
Fetching http://www.cpan.org/authors/id/J/JP/JPEACOCK/version-0.9904.tar.gz ... OK
Configuring version-0.9904 ... OK
==> Found dependencies: parent
--> Working on parent
Fetching http://www.cpan.org/authors/id/C/CO/CORION/parent-0.227.tar.gz ... OK
Configuring parent-0.227 ... OK
Building parent-0.227 ... FAIL
! Installing parent failed. See /Users/miyagawa/.cpanm/work/1378567529.25644/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'parent' is not installed
! Bailing out the installation for version-0.9904.
! Installing the dependencies failed: Module 'version' is not installed
! Bailing out the installation for Module-Metadata-1.000016.
--> Working on CPAN::Meta
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/CPAN-Meta-2.132140.tar.gz ... OK
...
@miyagawa
Owner
miyagawa commented Sep 7, 2013

If the argument isn't MakeMaker:

➜  ~  PERL_CPANM_OPT='' PLENV_VERSION=5.8.8 perl ~/dev/cpanminus/cpanm -l /tmp/adadada strict
==> Found dependencies: ExtUtils::MakeMaker, ExtUtils::Install
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-6.76.tar.gz ... OK
Configuring ExtUtils-MakeMaker-6.76 ... OK
Building ExtUtils-MakeMaker-6.76 ... OK
Successfully installed ExtUtils-MakeMaker-6.76 (upgraded from 6.30)
ExtUtils::Install is up to date. (1.54)
skipping R/RJ/RJBS/perl-5.18.1.tar.gz
1 distribution installed
@miyagawa miyagawa added a commit that referenced this issue Sep 7, 2013
@miyagawa Do not add Module::Build for dists to prefer MakeMaker, even when Bui…
…ld.PL exists (ExtUtils::Install) #311

Also, bootstrap EUMM earlier than circular dep check, so that local::lib will bootstrap even when MakeMaker is the argument.
3328403
@miyagawa
Owner
miyagawa commented Sep 7, 2013

Should be fixed now.

@miyagawa
Owner
miyagawa commented Sep 7, 2013
➜  cpanminus git:(devel) ✗ PERL_CPANM_OPT='' PLENV_VERSION=5.8.8 perl ~/dev/cpanminus/cpanm  -l /tmp/adadada ExtUtils::MakeMaker
==> Found dependencies: ExtUtils::MakeMaker, ExtUtils::Install
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-6.76.tar.gz ... OK
Configuring ExtUtils-MakeMaker-6.76 ... OK
Building ExtUtils-MakeMaker-6.76 ... OK
Successfully installed ExtUtils-MakeMaker-6.76 (upgraded from 6.30)
ExtUtils::Install is up to date. (1.54)1 distribution installed
@miyagawa miyagawa closed this Sep 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment