Skip Menu |

This queue is for tickets about the CPANPLUS CPAN distribution.

Report information
The Basics
Id: 32222
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: CPANPLUS

People
Owner: BINGOS [...] cpan.org
Requestors: schwern [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Installers should prefer Build.PL when both are available
Date: Thu, 10 Jan 2008 03:05:26 -0800
To: bug-CPANPLUS [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Since emulation will never be 100% and Module::Build's compatibility Makefile.PLs are a temporary measure to help installers which do not yet handle Module::Build, we recommend that all module installers prefer to use the Build.PL when both are available. The patch is simple enough, but I suspect that seemless Module::Build installation will have to be done (31279) before this is really viable. --- lib/CPANPLUS/Config.pm (revision 41142) +++ lib/CPANPLUS/Config.pm (local) @@ -309,11 +309,11 @@ =item prefer_makefile A boolean indicating whether or not prefer a C<Makefile.PL> over a -C<Build.PL> file if both are present. Defaults to 'true'. +C<Build.PL> file if both are present. Defaults to 'false'. =cut - $Conf->{'conf'}->{'prefer_makefile'} = 1; + $Conf->{'conf'}->{'prefer_makefile'} = 0; =item prereqs
On Thu Jan 10 06:06:38 2008, schwern@pobox.com wrote: Show quoted text
> Since emulation will never be 100% and Module::Build's compatibility > Makefile.PLs are a temporary measure to help installers which do not yet > handle Module::Build, we recommend that all module installers prefer to use > the Build.PL when both are available. > > The patch is simple enough, but I suspect that seemless Module::Build > installation will have to be done (31279) before this is really viable.
With 'configure_requires' support, M::B will be installed if required. We'll see how it acts in the wild and see if it's sensible to prefer Biuld.PL if possible.
Module::Build 0.35 does not like the way CPANPLUS 0.88 passes along Makefile.PL arguments. It seems all the arguments are being passed in as a string instead of an array? Not 100% sure if that bug is with M::B or CP+, but if M::B::Compat is in use and M::B 0.35 is installed, a module is no longer installable by CPANPLUS.
Here's the exact error message; [MSG] Extracted 'Params::Classify' to '/.cpanplus/5.10.0/build/Params-Classify-0.007' Running [/usr/bin/perl /usr/bin/cpanp-run-perl /.cpanplus/5.10.0/build/Params-Classify-0.007/Makefile.PL INSTALLDIRS=site INSTALLSCRIPT=/usr/local/bin]... Malformed argument ' INSTALLDIRS=site INSTALLSCRIPT=/usr/local/bin' at /usr/share/perl/5.10/Module/Build/Compat.pm line 232, <DATA> line 642. [ERROR] Could not run '/usr/bin/perl Makefile.PL': Malformed argument ' INSTALLDIRS=site INSTALLSCRIPT=/usr/local/bin' at /usr/share/perl/5.10/Module/Build/Compat.pm line 232, <DATA> line 642. -- cannot continue
I would have it prefer Build.PL if available *without* a config option. That's what I plan to do with CPAN.pm eventually. I'll investigate the problem and see what I can find. -- David
On Fri Aug 28 13:20:31 2009, CRAKRJACK wrote: Show quoted text
> Malformed argument ' INSTALLDIRS=site INSTALLSCRIPT=/usr/local/bin'
That looks suspiciously like two MakeMaker args passed as a single string to list-form of system(@args) rather than being split like a shell command would. There were problems in M::B::Compat about handling MakeMaker arguments at all, so it's possible that that fix exposed a CPANPLUS::Dist::MM bug. -- David
This hackery is what is making this work right now for my (slightly twisted) installation of CPANPLUS ($package is a CPANPLUS::Module object): my $dir = $package->extract(extractdir => $tempdir); # hack around https://rt.cpan.org/Ticket/Display.html?id=32222 if(-e "$dir/Build.PL" && -e "$dir/Makefile.PL") { warn "Makefile.PL and Build.PL both exist - deleting Makefile.PL"; unlink("$dir/Makefile.PL") or die "unlink('$dir/Makefile.PL'): $!"; $package->status->installer_type('CPANPLUS::Dist::Build'); } my $rv = $package->install( target => 'create', prereq_target => 'create', verbose => 1, skiptest => 1, prefix => $prefix, distdir => $repo_root, );
New versions of CPANPLUS will now set the default configuration of 'prefer_makefile' to be 0 in the following circumstances: if the version of perl is 5.10.1 or greater if both Module::Build and CPANPLUS::Dist::Build are installed and of suitable versions. Many thanks.