On Fri, Jun 19, 2009 at 12:20:23PM -0600, Curtis Jewell wrote: > On Fri, 19 Jun 2009 18:45 +0100, "Ash Berlin" <[email protected]> > wrote: > > On 19 Jun 2009, at 18:37, David Dooling wrote: > > > I am trying to clean up the prerequisites for a package that requires > > > both DBI and DBD::SQLite (UR). CPAN wants to order the prerequisites > > > in alphabetical order, so it tries to install DBD::SQLite first. It > > > comes to this part of the DBD::SQLite Makefile.PL code > > > > > > # Because DBI generates a postamble at configure-time, we need > > > # the required version of DBI very early. > > > my $DBI_required = 1.57; > > > eval { > > > require DBI; > > > }; > > > if ( $@ or DBI->VERSION < $DBI_required ) { > > > print "DBI 1.57 is required to configure this module, > > > please install it or upgrade your CPAN/CPANPLUS shell\n"; > > > exit(0); > > > } > > > > > > and fails (although the exit status is zero) because an older version > > > of DBI is installed. Even though DBI later appears and as PREREQ_PM > > > in the WriteMakefile call, that line never gets executed, the Makefile > > > never gets created, and CPAN will go no further with the DBD::SQLite > > > install. CPAN does continue to try to install other modules, > > > ultimately failing the requested install because DBD::SQLite is > > > missing (or too old). > > > > > > I am not sure what the issue around the DBI postamble is so I am not > > > sure how to fix this so DBD::SQLite to play nicely with CPAN. Any > > > ideas/guidance on how to get this to behave as one might expect? > > The DBI postamble copies two files from the DBI distribution into the > DBD driver's distribution - they're the standard framework for any XS > dbd driver. > > So the postamble is vital.
But if it were a PREREQ_PM, wouldn't it get installed before DBD::SQLite gets built? Or do those files need to be there before even the Makefile is created? > I would assume that there was an incompatible change or a necessary bug > fix in one or the other of these two files in the 1.56 -> 1.57 era that > would make compilation impossible, although I could be wrong. (It's > quite possible: > http://search.cpan.org/diff?from=DBI-1.56&to=DBI-1.57#Driver.xst - The > postamble itself hasn't changed since 1.56, so it's not that.) > > > Two possible solutions I can think of: > > > > 1) configure_requires. Doesn't help with old clients > > No, but it's the easiest way to help new ones. It can't hurt. This seems more applicable to DBD::SQLite than something that needs DBD::SQLite. Using that would require porting the entire DBD::SQLite build system to Module::Install (it currently uses ExtUtils::MakeMaker). > > 2) Use the 'Are we running under a CPAN shell' from the (now improved) > > Module::Install::AutoInstall. > > Do this, too. It will catch what the previous one does not. I'll try this (although I am not entirely sure if it will help; the docs are a little light). > > Oh, a bonus 3rd option. > > > > 3) Remove the check and delay it to the first test which does BAIL_OUT > > if DBI is too old. > > Does it even COMPILE if DBI is too old? It seems if DBI is a PREREQ_PM, both of these are moot since the appropriate version of DBI would be installed before compilation or testing. -- David Dooling _______________________________________________ DBD-SQLite mailing list [email protected] http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbd-sqlite
