Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 59031 - g-cpan.pl can't install DateTime::Format::Builder
Summary: g-cpan.pl can't install DateTime::Format::Builder
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-31 17:24 UTC by awk
Modified: 2005-03-14 10:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description awk 2004-07-31 17:24:41 UTC
running "g-cpan.pl DateTime::Format::Builder" starts installing the prerequisites okay, but it fails here:

emerging DateTime-Format-Builder
Calculating dependencies ...done!
>>> emerge (1 of 1) dev-perl/DateTime-Format-Builder-0.7804 to /
--- No package manifest found: /tmp/perl-modules_22624/dev-perl/DateTime-Format-Builder/Manifest
>>> md5 src_uri ;-) DateTime-Format-Builder-0.7804.tar.gz
>>> Unpacking source...
>>> Unpacking DateTime-Format-Builder-0.7804.tar.gz to /var/tmp/portage/DateTime-Format-Builder-0.7804/work
>>> Source unpacked.
/usr/bin/perl Build.PL config=prefix=/usr core destdir=/var/tmp/portage/DateTime-Format-Builder-0.7804/image/
Too early to specify a build action 'core'.  Do 'Build core' instead.
Couldn't run Build.PL: Bad file descriptor at /usr/lib/perl5/vendor_perl/5.8.4/Module/Build/Compat.pm line 109.
make: *** No targets specified and no makefile found.  Stop.

!!! ERROR: dev-perl/DateTime-Format-Builder-0.7804 failed.
!!! Function perl-module_src_compile, Line 58, Exitcode 2
!!! compilation failed


It looks like "Too early to specify a build action 'core'.  Do 'Build core' instead." is the important line in the error.

Reproducible: Always
Steps to Reproduce:
Comment 1 cluon 2004-09-02 08:59:34 UTC
I'm running into this same problem with Params::CallbackRequest.  It looks like there may be a prerequisite step in the build of the module that we're skipping here, but I'll need to take another look.  Keep in mind I am no Perl Guru though.. 

/usr/bin/perl Build.PL config=prefix=/usr core destdir=/var/tmp/portage/Params-CallbackRequest-1.13/image/
Too early to specify a build action 'core'.  Do 'Build core' instead.
Couldn't run Build.PL: Bad file descriptor at /usr/lib/perl5/vendor_perl/5.8.4/Module/Build/Compat.pm line 109.
Comment 2 cluon 2004-09-02 10:47:06 UTC
It looks like this is caused by the use of Module::Build.. the thing I'm confused about is that CPAN::Distribution->make doesn't seem to be conscious of Module::Build modules.. so I now have to track down how these things get automagically built in CPAN before I can figure out why it's broken in g-cpan.pl

foo.
Comment 3 cluon 2004-09-02 11:59:41 UTC
Build.PL for Module::Build is called via stub Makefile.PL..

The problem is in the Module::Build::Compat wrapper that maps Makefile.PL configuration variables into its own format.. in particular, there's a bug with the INSTALLDIRS map that can be fixed by changing:
INSTALLDIRS => sub {local $_ = shift; 'installdirs=' . /^perl$/ ? 'core' : $_ }
To:
INSTALLDIRS => sub {local $_ = shift; 'installdirs=' . (/^perl$/ ? 'core' : $_) }

in /usr/lib/perl5/vendor_perl/5.8.4/Module/Build/Compat.pm

I'll report this upstream (the problem is only with a directive of INSTALLDIRS=perl) to the CPAN module maintainer.  In the meantime, if you make the change above it should resolve the issue.
Comment 4 awk 2004-09-02 21:43:11 UTC
Awesome, that fixed it, thanks.

I checked a BSD box that happened to have p5-Module-Build-0.25.02 and it looks like the fix already exists in that version.
Comment 5 cluon 2004-09-03 08:49:57 UTC
Alright, after working with this a bit more, it looks like Module::Build doesn't handle paths properly with the arguments g-cpan.pl (and CPAN in general) hand into the Makefile.PL.

Module::Build version .25 does indeed fix this problem, but it raises another issue with the use of prefix=/usr being handed in.. In fact, it causes the build to die once again do to an attempt to catch people handing in a PREFIX on the build command line.

The good news is that Module::Build uses the site Config.pm to pull paths if no PREFIX is handed in, so simply removing the catch for PREFIX in Module::Build::Compat seems to resolve that issue.

What a headache..There's already an ebuild for moduld-build 0.25, it just hasn't been marked stable as of yet.  You can patch that after installation to resolve the PREFIX issue by editing: /usr/lib/perl5/vendor_perl/5.8.4/Module/Build/Compat.pm
and deleting the two lines:

   PREFIX => sub {die "Sorry, PREFIX is not supported.  See the Module::Build\n".
      "documentation for 'destdir' or 'install_base' instead.\n"},

Mayhaps I should open this as another bug with the appropriate details for Module::Build.. I don't think we'll be able to get the upstream to patch as their build scripts aren't built for this type of automation, it appears.
Comment 6 Michael Cummings (RETIRED) gentoo-dev 2005-03-14 10:28:58 UTC
Fixed in the next version, along with a change in the eclass to automagically handle Module::Build applications if needed.