Re: [Module-build-general] Module::Info
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2003-05-12 15:22:43
|
On Sunday, May 11, 2003, at 01:14 PM, Dominic Mitchell wrote: > I've just found an interesting problem. If you don't already have a > module installed, then Module::Info can fail when you do "make dist". > > For example, I've just found that I don't have Test::XML on my > workstation. This shouldn't be a problem, but when I tried to do > "make dist", I got this error message: > > Scanning lib/Test/XML/SAX.pm for packages > B::Module::Info,packages use failed with 2 saying: > Can't locate Test/XML.pm in @INC (@INC contains: > /home/dom/libexec/perl /home/dom/libs > /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl > /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at > /home/dom/work/Test-XML/lib/Test/XML/SAX.pm line 9. > > Test::XML::SAX is a module that depends upon Test::XML, both of which > are included in my distribution. > > I would guess that to fix this, you probably need to include blib/lib > and blib/arch in @INC somehow. However, this would mean that you need > to run a build before you make a dist. I'm not entirely sure that > this is the right answer, though... > > Just to confirm, I can manually fix the problem by doing: > > % perl Build > % env PERL5LIB="$PWD/blib/arch:$PWD/blib/lib" perl Build dist Hmm, this is a tough problem that seems to be inherent in the way Module::Info scans for packages. The problem is actually that it compiles the module, then walks the parse tree - but during compilation, any dependencies need to be available. If we could tell Module::Info to somehow ignore any missing modules from 'use' statements, that might be helpful. Otherwise I'm not sure Module::Info is a completely viable approach, even though it's probably "the right way" to do things. -Ken |