David Cantrell wrote:
On Tue, Nov 06, 2007 at 05:20:15PM +0000, Martin J. Evans wrote:

It appears from "Can't locate DBI.pm" that DBI is not installed but the Makefile.PL contains:

$opts{PREREQ_PM} = { DBI => 1.21 }

Your Makefile.PL doesn't get that far.  It gets as far as the "use DBI"
on line 15.  You can't make any assumptions about what is installed
until *after* Makefile.PL has run.

Thanks, I missed that - I only took over DBD::ODBC recently. The actual problem is you need DBI because you need a function from DBI to locate DBIXS.h etc in order to create the Makefile.
so long as ExtUtils::MakeMaker version is >= 5.43. If I put $opts{PREREQ_FATAL} = 1 in the Makefile.PL will this stop this error being reported again.

You can put "i am a herring" in there for all the difference it will
make :-)  Your Makefile.PL will still break at line 15.  The solution
is rather involved:

  eval "use DBI 1.21";
  if($@) {
      ... stuff that uses CPAN.pm to install DBI goes here ...
  }
  eval "use DBI 1.21";
  if($@) {
      warn("
          Something's badly broken with your environment, I couldn't
          install DBI
      ");
      exit(0);
  }

hmm. Are you saying if I did this properly (as above) then the cpan testers tests would get past this? Do you know of another module which does this as above? As far as I can see this is the first time DBD::ODBC has failed in this way from cpan testers and yet it has been this way for years. I greatly appreciate the cpan testers work (this time it picked up a bug with using older perls for instance) so I'd be happy to make any changes to make cpan testing better. Perhaps I need to do some research on cpan testing to see what is recommended.

Do that for every non-core module you want to use in Makefile.PL.


Thanks for all your efforts.

Martin

Reply via email to