After starting a big crapstorm on the perl-qa list about META.yml generation in ExtUtils::MakeMaker vs. Module::Build, and Schwerns following rant about Module::Build, I decided to eat the dog food I’ve created and convert to using Module::Build and Build.PL.
Minutes after starting I had issues with my dists that were based on Apache::Test. When running perl Build test I would be in an endless loop of A::T asking where Apache.exe was. That info was already in Apache/TestConfigData.pm and worked just fine under ExtUtils::MakeMaker and Makefile.PL.
After a couple weeks of ignoring the problem and a few hours of frustration this evening, I finally found the problems. Yes, two problems not just one.
First, under Makefile.PL, we have these two lines:
$build->generate_script('t/TEST'); $build->generate_script('t/SMOKE');
This generates t/TEST and t/SMOKE, and calling make test always ran t/TEST.
Now under Build.PL, those same two lines also created t/TEST and t/SMOKE, but running perl Build test trys to run t/SMOKE as the test script. That’s the first problem. To further illustrate the issue this code:
$build->generate_script('t/TEST'); $build->generate_script('t/SMOKE'); $build->generate_script('t/POOP');
would cause perl Build test to try and run t/POOP as the apache test script.
This leads me two the second problem [but the first symptom]. This sequence:
perl Makefile.PL perl t/TEST perl t/SMOKE
works just fine. TestConfigData.pm is read and everyone is happy. However:
perl Makefile.PL perl t/SMOKE
fails with the “where’s apache” loop. It appears that t/TEST autogenerates t/conf/apache_test_config.pm while t/SMOKE does not. So, for now, t/SMOKE requires that t/TEST runs at least once before it.
As for the solution, changing the Build.PL to:
$build->generate_script('t/SMOKE'); $build->generate_script('t/TEST');
solves the current problem. It’s not clear which version of generate_script (TestMM.pm vs. TestMB.pm) is correct or whether the config autogen behavour is really missing from t/SMOKE (TestSmoke.pm) or if that is by design.