Preventing missing dependencies

Adam Kennedy adam at phase-n.com
Sun Feb 26 23:43:32 GMT 2006


The main problem here for most CPAN things is that CPAN Testers does not 
handle this sort of dependency problem well. I don't mean to keep going 
on about a project that most people don't have access to yet, but PITA 
is specifically designed to do most of the the installations from 
scratch, and so should be able to catch these errors correctly.

In the more general non-CPAN case, the big problem with adding such 
protection at compile-time is that the volume of work required to answer 
the question "has it been declared" is _enormous_.

Also, putting it at compile-time is not much help to anyone but the 
original author, because only they can fix it.

I can imagine, however, a notional combination of a META.yml parser, 
Module::ScapDeps and PPI that would let you apply this check at 
packaging time, rather than compile time.

Adam K

Paul Makepeace wrote:
> An ongoing source of frustration for those of us installing on fresh
> boxen are modules that don't have adequate build & test dependencies
> set. It's one of those classes of errors that seems to be "dumb" in the
> sense of being automatically preventable, and yet isn't quite yet.
> 
> I've heard of one project to build a cpan farm and automatically issue
> RT tickets for missing deps. That's great but it needs to be closer to
> the coalface.
> 
> How about: modify the behaviour of 'use' to fail unless a module has been
> listed in the build/test dependencies.
> 
> "attempt to use Blah without specifying it as a dependency in Foo.pm line 4"
> 
> There's some finesse needed to allow depended-upon modules that are
> pulled in by the parent module, e.g. Jo Programmer shouldn't need to put
> a dependency in for HTTP::Status when using LWP::Simple.
> 
> I'm not sure whether it's even possible to modify use like that without
> a source filter...
> 
> Paul (cc'ing Module::Install authors; apols if some of you aren't current)
> 


More information about the london.pm mailing list