Hi,

I look after DBD::ODBC.

In the past week I've had 4 cpan-test reports for failures of which 2 were genuine mistakes not working on very old Perls (thus proving the benefit of cpan-testers - thanks) and 2 were down to a missing module dependency. Before then all cpan-test failures were actual module errors not related to failure to have a module my module depends on so I'm assuming the way cpan-testing is done has changed.

After discussion with the cpan testers involved I've been advised to install the module my module depends on if it was not found. However, I'm having problems with this idea because I believe although it may lead to a test success 1. I don't think it helps real people install my module 2. I don't think it guarantees not failing because of the missing module. Here is the background:

My module needs DBI. DBI generates C code and headers which must be included in DBD::ODBC. To pick up this code and headers I need to call a DBI function in my Makefile.PL and hence I need to "use DBI". Putting DBI in PREREQ_PM for MakeMaker does not help me since I need DBI before calling WriteMakefile because I need to set the %opts I pass to WriteMakefile.

I can detect DBI is not installed and attempt to install it with CPAN but:

1. I believe this will fail in most circumstances (i.e. ignoring Perl is installed in their home account) if the user is not running as root. Most people installing modules by hand (not through CPAN) do not run as root but have Perl installed in a root owned dir, they do perl Makefile.PL, make, make test, sudo make install (or su and make install).

I know you can set CPAN up to specify sudo for the make install but I don't believe many people do. As a result, I believe if I change DBD::ODBC to detect and install a missing DBI I believe I may cause more problems than I fix and for all I know cpan-testers will simply fail my module if the install for DBI fails (so I'd inherit a failure).

2. What happens if the module my module depends on also depends on an external library and I attempt to install it when that external library is missing. Does my module fail then also.

I've read the thread on this list "PM post on Makefile.PL FAIL for missing libraries" and others, I've seen Devel::CheckLib etc but I don't see a real solution right now for avoiding failures without compromising the ease of install of my module.

I'd also like to know the definitive way of failing a Makefile.PL because of a missing external library without causing a test failure.

Thanks.

Martin

Reply via email to