in reply to Re: Updating distributions with Module::Build, Module::Starter, and PPM::Make
in thread Updating distributions with Module::Build, Module::Starter, and PPM::Make

If you feel you must, go ahead and include a fully functional Makefile.PL (not a "compatibility" one depending on Module::Build).

Is there something wrong with the one that M::B generates for you? I guess I could use Module::Starter to generate a Makefile.PL with E::MM and a Build.PL with M::B.

  • Comment on Re^2: Updating distributions with Module::Build, Module::Starter, and PPM::Make

Replies are listed 'Best First'.
Re^3: Updating distributions with Module::Build, Module::Starter, and PPM::Make
by ysth (Canon) on Aug 26, 2004 at 19:41 UTC
    It's a little complicated; basically, in some ways, M::B is a step backwards, not a step forwards.

    Under EU::MM, to determine dependencies, you run Makefile.PL, which is allowed to tailor a list of dependencies specific to that particular installation, then read the dependencies from the "# PREREQ_PM" line in the generated Makefile.

    Under M::B, AIUI, dependencies are hardcoded in META.yml (though it does have the nice distinction between requires: and build_requires:).

    ActiveState seems to make a real attempt to validate the dependencies by running Makefile.PL in a clean environment, adding any resulting dependencies, then doing the make. But Makefile.PL's built with Module::Build::Compat's small or passthrough options require Module::Build to be installed or installable to work at a point where in the EU::MM universe, dependency information isn't yet available. You can see a passthrough Makefile.PL in action here.

    Module::Build::Compat's traditional option will work, but that won't do everything Build.PL can, so I'm not sure I see the point in not just staying with EU::MM (especially for existing modules).

    An additional note: even if META.yml were checked before running Makefile.PL, in the examples I've seen, Module::Build isn't listed as a dependency there even though it is required for the build.

      Under M::B, AIUI, dependencies are hardcoded in META.yml

      This is incorrect.

      M::B describes dependencies in its Build.PL just like EU::MM describes its dependences in Makefile.PL. The META.yml is generated from this description (as, indeed, it is with the latest EU::MM).

      An additional note: even if META.yml were checked before running Makefile.PL, in the examples I've seen, Module::Build isn't listed as a dependency there even though it is required for the build.

      Just as EU::MM isn't included in the META.yml files that EU::MM generates.

        With the small difference that EU::MM is in the Perl core and thus can be expected to be available, whereas Module::Build isn't. There remains the issue of version incompatibilities between different EU::MM versions of course, but seemingly that issue is not as apparent.

        Thanks for correcting me. I saw the build action didn't regenerate META.yml, so assumed incorrectly that a way for Build.PL to indicate requirements to an external tool. I see now that the distmeta action does this (the "dist" prefix had made me think it was something that should only be done as part of preparing a distribution), or you can do what CPANPLUS does after running the build action:
        my $build = Module::Build->resume( properties => { config_dir => File::Spec->catdir($args->{'dir'}, "_build" +), build_script => 'Build', } ); my $failures = $build->prereq_failures;
      Am I misguided to want to include a Build.PL for people using M::B instead of make to install modules?

      I know that most people still use make but I thought it would be nice to also include a Build.PL in the distribution.