lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <mar...@rectangular.com>
Subject Re: [lucy-dev] Failed: PAUSE indexer report KARMAN/Lucy-0.3.0.tar.gz
Date Thu, 01 Mar 2012 23:09:25 GMT
On Thu, Mar 01, 2012 at 10:37:41AM -0800, David E. Wheeler wrote:
> * Why are you reading a version before it’s built?

This is a two part answer.

*Our* code needs the version number because it has to be embedded in the Lucy
shared object.  (The version number needs to be embedded in the shared object
because the XSLoader::load() invocation from Lucy.pm validates the version and
throws an error if they don't match.)

However, *our* code is no longer a problem, because I've changed it to use
regexes rather than the Module::Build::ModuleInfo routine.

The current problem with Perl 5.14.1 seems to be that *Module::Build* wants to
build MYMETA.json/MYMETA.yml when you run "perl Build.PL", and it apparently
needs per-package version information for that.

Maybe we could persuade Module::Build not to run the version parsing code if
we kept a current META.json file around, but I don't think that's a good
solution.  First, META.json is a serious PITA to keep up-to-date.  Second,
there's no guarantee that Module::Build won't run that version extraction code
under other circumstances -- where and when M::B decides that it wants to run
its version extraction routine is an implementation detail of M::B, since it
assumes that routine is always safe to run.

> * Why are you reading the version at all? If that's a subclass of
>   Module::Build, you can just use $self->dist_version 

$self->dist_version is an X.Y.Z version number; $Lucy::VERSION is an X.YYYZZZ
version number.  We need the X.YYYZZZ version number to build the XS
extension so that it will match what is in Lucy.pm.

It is theoretically possible to derive an X.YYYZZZ version from an X.Y.Z
version number, but I don't know whether dist_version() is going to give us a
string or a version.pm object.  It is simpler to just pull it out of Lucy.pm
ourselves with a regex than to guarantee that we can derive it under all
possible configurations.

> * Module::Build::ModuleInfo is deprecated; use Module::Metadata instead.

Our own usage of Module::Build::ModuleInfo has now been eliminated entirely,
so there is no longer any need to transistion to Module::Metadata.

> > It is hard to guarantee that that ModuleInfo code will not be run too soon, as
> > it seems that Module::Build assumes it will always be safe.
> 
> It should be.  Lucy.pm should not `require Lucy`. It is choking on reading
> the version from Lucy.pm, yes?

Module::Build is having problems reading lib/Lucy/Store/RAMFile.pm.  Here is
that file's contents, minus comments:

    package Lucy::Store::RAMFile;
    use Lucy; our $VERSION = $Lucy::VERSION;

    1;

Error message below.  Note that the build actually completes; it just
complains loudly.

Marvin Humphrey


marvin@smokey:~/projects/lucysvn3/perl $ /Users/marvin/opt/perl5141/bin/perl5.14.1 Build.PL

Error evaling version line 'BEGIN { q#  Hide from _packages_inside()
    #; package Module::Metadata::_version::p5;
    use version;
    no strict;

    local $VERSION;
    $VERSION=undef;
      $vsub = sub {
        use Lucy; our $VERSION = $Lucy::VERSION;;
        $VERSION
      };
  }' in /Users/marvin/projects/lucysvn3/perl/lib/Lucy/Store/RAMFile.pm: Can't locate loadable
object for module Lucy in @INC (@INC contains: lib clownfish/perl/blib/lib clownfish/perl/blib/arch
../clownfish/perl/blib/lib ../clownfish/perl/blib/arch buildlib /Users/marvin/opt/perl5141/lib/site_perl/5.14.1/darwin-2level
/Users/marvin/opt/perl5141/lib/site_perl/5.14.1 /Users/marvin/opt/perl5141/lib/5.14.1/darwin-2level
/Users/marvin/opt/perl5141/lib/5.14.1 .) at lib/Lucy.pm line 29
BEGIN failed--compilation aborted at lib/Lucy.pm line 29, <GEN14> line 17.
Compilation failed in require at (eval 40) line 9, <GEN14> line 17.
BEGIN failed--compilation aborted at (eval 40) line 9, <GEN14> line 17.

failed to build version sub for /Users/marvin/projects/lucysvn3/perl/lib/Lucy/Store/RAMFile.pm
at /Users/marvin/opt/perl5141/lib/5.14.1/Module/Metadata.pm line 539, <GEN14> line 17.

WARNING: Possible missing or corrupt 'MANIFEST' file.
Nothing to enter for 'provides' field in metafile.
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Lucy' version '0.3.0'
marvin@smokey:~/projects/lucysvn3/perl $ 


Mime
View raw message