For some time, I've been using this pattern in my Build.PL:
configure_requires => { 'Module::Build' => '0.30' },
create_makefile_pl => 'traditional',
build_requires => { 'Module::Build' => '0.30' },
However, while the build with Build.PL requires Module::Build, the build with the generated Makefile.PL does not. However, Module::Build::Compat puts anything found in build_requires into PREREQ_PM. So folks who are building my modules with Makefile.PL are having to satisfy that dependency even though it's not required. Peter Scott (Cc'd) emailed me about this last week, pointing out that it's a silly requirement for, for example, RPM packagers.
So what steps should I take for this, since configure_requires isn't supported in older Perls? The options, as I see them, are:
1. Omit Module::Build from build_requires and hope that configure_requires takes care of most cases. That seems dubious.
2. Tweak Module::Build::Compat to omit Module::Build from PREREQ_PM when it's only in build_requires, on the assumption that it isn't actually needed for the build. This sometimes won't be true, in some small number of cases, I expect.
3. Give up on Module::Build::Compat and start maintaining Makefile.PL myself. I know a lot of folks are using dzil for this, but I haven't made that jump yet and have a *lot* of modules that I'd have to convert over (not an RJBS number of modules, mind you, but still pretty significant).
My thought is that if #3 really is the best choice, then it might be time to actually deprecate M::B::Compat.
Thoughts?
Thanks,
David
You really don't need Module::Build in build_requires. Because if you
don't have M::B, and Build.PL will be run, it will fail before any
CPAN client will be able to install M::B.
2011/3/7 David E. Wheeler <da...@kineticode.com>:
> Builders,
>
> For some time, I've been using this pattern in my Build.PL:
>
> configure_requires => { 'Module::Build' => '0.30' },
> create_makefile_pl => 'traditional',
> build_requires => { 'Module::Build' => '0.30' },
>
> However, while the build with Build.PL requires Module::Build, the build with the generated Makefile.PL does not. However, Module::Build::Compat puts anything found in build_requires into PREREQ_PM. So folks who are building my modules with Makefile.PL are having to satisfy that dependency even though it's not required. Peter Scott (Cc'd) emailed me about this last week, pointing out that it's a silly requirement for, for example, RPM packagers.
>
> So what steps should I take for this, since configure_requires isn't supported in older Perls? The options, as I see them, are:
>
> 1. Omit Module::Build from build_requires and hope that configure_requires takes care of most cases. That seems dubious.
--
Alexandr Ciornii, http://chorny.net
> Hello, David.
>
> You really don't need Module::Build in build_requires. Because if you
> don't have M::B, and Build.PL will be run, it will fail before any
> CPAN client will be able to install M::B.
Well, one *might* need it if one were using features of M::B added since the the version used by the user, and the user's version doesn't recognize configure_requires, either. For the module in question, Test::Pod, I think that it does nothing special at all. So I've removed it from configure_requires. But I wouldn't mind seeing some way to tell M::B::Compat not to include it if it's not needed in the Makefile.PL but *is* needed in the Build.PL build_requires.
Best,
David