Clear questions and runnable code
get the best and fastest answer
Module::Buildby rinceWind (Monsignor)
|on Apr 30, 2003 at 16:50 UTC||Need Help??|
Item Description: A replacement for ExtUtils::MakeMaker
Review Synopsis: Module::Build is the future of CPAN installs
There is much talk in the Perl world about Module::Build. Discussion surfaced originally around February 2003, when Mike Schwern published a paper of advocacy. Please refer to this thread for PM's reaction at the time.
More recently, I attended a Perl monger tech talk, at which Schwern was presenting "MakeMaker is doomed!". Prior to the talk, I was somewhat skeptical. After all, Makefile.PL works, Nearly all of CPAN uses a recognised and recognisable installation process:
I'd also heard that some prominent people in the Perl community have abandoned MakeMaker for all new modules, in favour of Module::Build. Having attended the talk, I began to see why.
PortabilityThe MakeMaker method relies on two mechanisms which are not truly cross-platform:
This is indeed what Module::Build is, and it calls no modules which use XS. The steps are replaced with:
In my opinion, Build.PL should have been named Configure.PL, so as to remove completely, any confusion between the first two steps. I am raising this point with Ken Williams and others.
I came away from Schwern's talk convinced that Module::Build is the future. Also, there is talk that it is entering the core of 5.10, which will greatly help the advocacy cause.
Complex configurationIn the mean time, there is a circumstance when I would completely recommend adopting Module::Build. The initial step, running the perl program Makefile.PL has been greatly simplified and freed. For trivial installations, there is probably no mileage in moving to Module::Build, as the Makefile.PL contains a single call to WriteMakefile. For non-trivial installations, you might experience difficulties getting help writing and fixing your Makefile.PL.
Module::Build uses an OO interface, and the actions that you want to do in configuration are method calls. For doing _really_ clever stuff you can subclass Module::Build.
Using Module::Build for other than modulesThis new flexibility means that Module::Build becomes available for other purposes - in fact for any kind of controlled install. For example, it can be used to deploy database schemas and suites of standalone perl scripts. An example of a project where this has been used is on OpenGuides - a project I am involved with.
ConclusionIt seems quite stable now, and there are many people out there using it. I am not advocating a wholesale morphing of CPAN to this mechanism overnight. Once 5.10 goes in and stable with Module::Build in the core, we should push for all new modules to use it.
Update, October 2004I am nowhere near as happy with Module::Build as when I originally wrote this review. In particular, I have the following issues: