Dual-Build Modules (What to do if both Makefile.PL and Build.PL exist)
Recently I sent an e-mail with the same subject for discussion with
the module-authors and module-build lists.
I've only got two responses, but it seems that at least two people
other than myself think it's worthwhile to revert the behaviour of
dh-make-perl to choose Build.PL before Makefile.PL. However, I do not
know the reasoning for changing this behaviour, so it is entirely
likely that I've missed something.
My argument for switching to Build.PL over Makefile.PL is thus: in
Module::Build modules that produce a Module::Build::Compat Makefile.PL
for compatibility, there is a Makefile left around even after the
cleanup happens. This looks like a bug in Module::Build::Compat not
adding Makefile in with its cleanup scripts, but nonetheless, it
sticks around and wreaks havoc until it's removed.
If you do a 'debian/rules clean', it will run Build.PL's cleanup which
removes Build and all intermediate files, EXCEPT for the Makefile that
was generated. This means that running 'debuild' again will trigger
the 'Makefile' to execute, and the Makefile does not run 'perl
Build.PL' itself. Instead, that initialization is done in Makefile.PL,
which is no longer executed since Makefile exists.
There was some discussion here from CPAN module authors:
For various reasons the general consensus seems to be to pick Build.PL
first, and fall back on Makefile.PL if unavailable.
I look forward to seeing what others have to say about this.