Dist::Zilla - detect missing/uninstallable prereqs

35 views Asked by At

Is there a Dist::Zilla plugin which will make "dzil build" (or "dzil release") check that all prerequisites are actually met on the build system?

Merely building successfully is not enough, because there can be dependencies in the generated META.yaml which can never be met when the package is later installed by others.

For example (this happened to me): The code contains

  if ($^O eq "MSWin32") {
    require Win32API::Net;
    ...do something...
  }

and in dist.ini

[OSPrereqs / MSWin32]
Win32API::Net = 0

But what I failed to do was tell AutoPreqs to not make Win32API::Net an unconditional build requirement (by adding skip = ^Win32API::).

Since Win32API is only installable on Windows, the distribution could not be installed on Linux. And to my chagrin I did not find out until after the new release hit CPAN!

Is there a way I can prevent such things happening?

If dzil release checked that all "requires" listed in the generated META.yaml are met, it would have found the mistake before pushing a broken release to CPAN. It might also detect that the release was being tested with insufficiently-recent versions of required modules.

0

There are 0 answers