Bootstrapping Is Harder Than It Looks

chromatic on 2005-06-10T05:28:38

In my copious free time not taken up by a dozen other projects, I've been working on Module::Build::TestReporter to make version 1.0 available before Perl Testing: A Developer's Notebook comes out. (I still have yet to bundle Test::Kwalitee.)

After the first release, Stig Brautaset pointed out that there's a bootstrapping problem for people who want to use MBTR. It depends on a few non-core modules, but if you're using Module::Build::TestReporter for your distribution, it won't load without those dependencies -- and you want to mark the build dependencies in your Build.PL file. (You also need to ship MBTR with your distribution, but I can't do much besides document that fact.)

The approach I chose was to attempt to load the necessary modules, trapping any errors. If something failed, I install a different constructor that adds the necessary files to the build_requires parameter and calls Module::Build::new(), which handles the dependencies appropriately.

Testing that logic was a bit of fun, too. Sometimes I wonder if we test module writers test our test modules just to make us less smug.


Test::Kwalitee?

domm on 2005-06-10T19:01:59

What's Test::Kwalitee? Any relations to CPANTS I should know about?

Re:Test::Kwalitee?

chromatic on 2005-06-10T20:00:19

It's a developer test module (like the POD coverage tests) that evaluates a distribution with several of the Kwalitee metrics. I find it pretty handy during ./Build disttest.

Re:Test::Kwalitee?

domm on 2005-06-12T13:27:28

And are you using the same Kwalitee metrics as Module::CPANTS::Generator? Are you actually using Module::CPANTS::Generator?

Re:Test::Kwalitee?

chromatic on 2005-06-13T04:48:34

Yes, it actually uses Module::CPANTS::Generator.