Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Makefile.PL and Build.PL

by dragonchild (Archbishop)
on Mar 04, 2005 at 13:59 UTC ( [id://436575]=perlquestion: print w/replies, xml ) Need Help??

dragonchild has asked for the wisdom of the Perl Monks concerning the following question:

My CPAN distros have always used Makefile.PL from ExtUtils::MakeMaker. I'm considering adding a Build.PL from Module::Build. Now, I know that Build.PL can provide Makefile.PL emulation. However, I'm wondering what the monks think about providing parallel, but unconnected Makefile.PL and Build.PL.

My initial thoughts are:

  • Dual maintenance - if I make a change to the build, I have to make it in two places. Now, I'm currently the only developer on my code, so that's not a major issue.
  • I don't force Makefile.PL users to move away from PREFIX - this is a big one for me, personally. I'm not completely comfortable yet with Build.PL.
  • If I do parallel maintenance, I don't piss anyone off. :-)

Update: I noticed that Module::CoreList does this ... do any other distros do this?

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re: Makefile.PL and Build.PL
by itub (Priest) on Mar 04, 2005 at 14:22 UTC
    I think it's great for the users, if you are willing to do it, but be careful because if someone complains about installation problems you'll have an extra variable to consider ("did you use Makefile.PL, or Build.PL?").

    Perhaps something that you can do is use a templating system to generate both Makefile.PL and Build.PL from a common source so that you only have to change things once. :)

    Update: After looking at things in more detail, I see that perhaps you don't need to use templates at all. Module::CoreList autogenerated its Makefile.PL by using Module::Build::Compat with the create_makefile_pl => 'traditional' option in Build.PL.

Re: Makefile.PL and Build.PL
by eyepopslikeamosquito (Archbishop) on Mar 05, 2005 at 00:09 UTC
    I noticed that Module::CoreList does this ... do any other distros do this?

    Yes. In the early days of Module::Build, I provided a parallel but unconnected Build.PL, just to get a feel for Ken's shiny new module and how it worked. I kept them separate because I wanted people to be able to install my module even if Module::Build was broken (and it was often broken in those very early days).

    Naturally, I was appalled by the horrific camel-like code duplication in two places, Makefile.PL and Build.PL, but was willing to endure this as a convenience to my users. :-)

    Much to my surprise, the simple act of adding a new (and unrelated) Build.PL caused my module to fail ActiveState's automated build process because, at that time, if a distribution contained both a Makefile.PL and a Build.PL, the ActiveState auto-builder chose the Build.PL (and the current Module::Build at that time failed its Windows tests). That has since been changed, ActiveState's auto-builder now chooses Makefile.PL if both exist.

    Oh, and after adding the new and unrelated Build.PL, I had to change:

    WriteMakefile( NAME => 'Acme::EyeDrops', VERSION => '1.45', );
    to:
    WriteMakefile( NAME => 'Acme::EyeDrops', VERSION => '1.45', PL_FILES => {} );
    in Makefile.PL to stop it trying to invoke Build.PL.

Re: Makefile.PL and Build.PL
by samtregar (Abbot) on Mar 04, 2005 at 19:17 UTC
    I'm considering adding a Build.PL from Module::Build.

    Why? My impression is that Module::Build is usually something people switch to when they've had it with MakeMaker. But if you're considering keeping MakeMaker onboard that must not be your reason...

    To answer your question, I think keeping a real Makefile.PL around is a great idea. I make frequent use of PREFIX and modules that don't support it are a real pain.

    -sam

Re: Makefile.PL and Build.PL
by PodMaster (Abbot) on Mar 04, 2005 at 23:04 UTC
    I see no point in doing it. Module::Build is far from ready for primetime.

    If I do parallel maintenance, I don't piss anyone off. :-)
    MakeMaker is prevelant, so people already have to be setup for MakeMaker, so there is no one to piss off.
    Update: I noticed that Module::CoreList does this ... do any other distros do this?
    Module::CoreList doesn't do it. Module::CoreList uses Module::Build which generates a traditional Makefile.PL, which is the only kind that it should be allowed to generate (the passthrough only serves to annoy)

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://436575]
Approved by Limbic~Region
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-25 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found