Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 135890

Summary: perl-module.eclass adds circular dependency between dev-perl/ExtUtils-CBuilder and dev-perl/module-build
Product: Gentoo Linux Reporter: Jörg Gollnick <gentoo-bugs>
Component: EclassesAssignee: Gentoo Perl team <perl>
Status: RESOLVED FIXED    
Severity: major CC: dwc, jakub
Priority: Highest    
Version: 2006.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jörg Gollnick 2006-06-07 04:00:02 UTC
ExtUtils-CBuilder can be build either using Maefile.PL or Build.PL.
ExtUtils-Cbuilder and module-build depends each other.
First time builds have to work without module-build installed.
So perl-module.eclass should be aware of this and not try Build.PL, if Makefile.PL exists.

>>> Emerging (1 of 7) dev-perl/ExtUtils-CBuilder-0.18 to /
>>> checking ebuild checksums ;-)
>>> checking auxfile checksums ;-)
>>> checking miscfile checksums ;-)
>>> checking ExtUtils-CBuilder-0.18.tar.gz ;-)
>>> Unpacking source...
>>> Unpacking ExtUtils-CBuilder-0.18.tar.gz to /buildtmp/tmp/portage/ExtUtils-CBuilder-0.18/work
>>> Source unpacked.
>>> Compiling source in /buildtmp/tmp/portage/ExtUtils-CBuilder-0.18/work/ExtUtils-CBuilder-0.18 ...
 * Using ExtUtils::MakeMaker
Checking if your kit is complete...
Looks good
Writing Makefile for ExtUtils::CBuilder
 * Using Module::Build
Can't locate Module/Build.pm in @INC (@INC contains: /etc/perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux /usr/lib64/perl5/vendor_perl/5.8.8 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux /usr/lib64/perl5/site_perl/5.8.8 /usr/lib64/perl5/site_perl /usr/lib64/perl5/5.8.8/x86_64-linux /usr/lib64/perl5/5.8.8 /usr/local/lib/site_perl .) at Build.PL line 1.
BEGIN failed--compilation aborted at Build.PL line 1.

!!! ERROR: dev-perl/ExtUtils-CBuilder-0.18 failed.
Comment 1 Jörg Gollnick 2006-06-07 05:43:53 UTC
Minimal patch works for module-build.

--- /usr/portage/eclass/perl-module.eclass      2006-06-06 16:35:50.000000000 +0200
+++ perl-module.eclass  2006-06-07 13:33:12.361209602 +0200
@@ -103,7 +103,7 @@
                perl Makefile.PL ${myconf} INSTALLMAN3DIR='none'\
                PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D} || die "Unable to build! (are you using USE=\"build\"?)"
        fi
-       if [ -f Build.PL ] ; then
+       if [ -f Build.PL ] && [ ! -f Makefile.PL ]; then
                einfo "Using Module::Build"
                perl Build.PL --installdirs=vendor --destdir=${D} --libdoc= || die "Unable to build! (are you using USE=\"build\"?)"
        fi
Comment 2 Michael Cummings (RETIRED) gentoo-dev 2006-06-07 14:15:26 UTC
i actually had it that way at one point and ran into other problems (which of course i can't put my finger on - looong day). I'll add it back in for now (because we really need that die in there, which was the addition that broke this for you), but this might have to be revisited again. sync in a few hours and close this out when you see it back :)
Comment 3 Jörg Gollnick 2006-06-07 14:31:32 UTC
(In reply to comment #2)
I ended in an unusable module-build, so that I add the special handling for module-build to the patch. 
May be && [ ! -f Makefile ] is a more reliable solution (only doing something if perl Makefile.PL not produced a Makefile).


--- /usr/portage/eclass/perl-module.eclass      2006-06-06 16:35:50.000000000 +0200
+++ perl-module.eclass  2006-06-07 16:21:15.915148939 +0200
@@ -103,7 +103,7 @@
                perl Makefile.PL ${myconf} INSTALLMAN3DIR='none'\
                PREFIX=/usr INSTALLDIRS=vendor DESTDIR=${D} || die "Unable to build! (are you using USE=\"build\"?)"
        fi
-       if [ -f Build.PL ] ; then
+       if ( [ -f Build.PL ] && [ ! -f Makefile.PL ] ) || ( [ -f Build.PL ] && [ ${PN} == "module-build" ] ) ; then
                einfo "Using Module::Build"
                perl Build.PL --installdirs=vendor --destdir=${D} --libdoc= || die "Unable to build! (are you using USE=\"build\"?)"
        fi
Comment 4 Daniel Westermann-Clark 2006-06-08 18:42:50 UTC
This seems to break ebuilds for Perl modules which use a "passthrough" Module::Build Makefile.PL, e.g. bug 136041.
Comment 5 Michael Cummings (RETIRED) gentoo-dev 2006-06-12 13:12:30 UTC
caught in bug 136465 and fixed - closing this one out, its done all the damage it can  :)