On Wed, Jun 25, 2008 at 6:33 AM, Peter Flanigan via RT
<bug-CPAN-Reporter@rt.cpan.org> wrote:
Show quoted text> ' in lib/Data/CloudWeights.pm: Can't locate version.pm in @INC
> (@INC contains:
> [snip]
> My understanding is that because the META.yml contains
>
> build_requires:
> Test::More: 0.74
> version: 0.74
>
> the version module should be installed before Makefile.PL is executed
This is a bug in Data::CloudWeights, though it's a subtle one caused
by the way you are using version.pm.
Because you are using VERSION_FROM in your Makefile.PL, version.pm is
a *configure-time* dependency, not a build-time dependency. This is
now officially enshrined in the latest META.yml specification as
"configure_requires" -- which is supported in recent versions of
CPAN.pm (including the one on the machine that generated the test
report).
See:
http://module-build.sourceforge.net/META-spec-current.html
Furthermore, the version.pm documentation is half right and half
wrong. Module::Build (latest release) does have it's own 'version
object' for compatibility at configure-time. But the version.pm
documentation is correct that ExtUtils::MakeMaker does not. And you
are trying to use version.pm with EU::MM, which is going to fail
unless version.pm is installed *before* Makefile.PL is run and normal
dependencies aren't installed until after the PL has finished.
And even if you set 'requires' and 'build_requires' in META.yml, those
requirements are generally not used because of an obscure META.yml
setting, 'dynamic_config', which defaults to *true* if missing. That
signals that requirements can't be trusted unless dynamically
generated by running Makefile.PL or Build.PL. This is a quirk of
META.yml. So your dependencies aren't installed because the
Makefile.PL died and dependencies aren't installed by CPAN.pm until
after Makefile.PL runs and determines the "official" prerequisites.
Fortunately, this behavior doesn't apply to 'configure_requires',
which is always valid as it applies before *.PL is ever run.
So you have a number of options:
* configure_requires for version.pm (but this won't help on older
versions of CPAN.pm)
* use Build.PL instead of Makefile.PL as newer versions can handle version
* 'use 5.010' -- as 5.10 includes version objects by default
* bundle the pure perl version.pm in inc/ and add that to @INC if $] <
5.009005 (but could be buggy)
* set your version explicitly in Makefile.PL instead of having
"VERSION_FROM" (I think that will let the PL finish and then the
prerequisites should be loaded before your code actually runs).
But the NA report is actually correct. A stock perl 5.8.8 can't
handle your distribution because of the way you use version.pm.
As a side note, I notice in your latest release that you have "exit 0"
in Makefile.PL if it appears to be running on my smoke test machine
(@INC matching 'home/david'). That's a pretty severe option for
something that is only generating an 'NA' report and it could impact
any other potential user with that username. In the future, if you
have questions about some test report I've filed, please feel free to
contact me directly and I'm happy to figure out whether the problem is
in the smoker or in your code.
Regards,
David