in reply to Re: Module::Build::XSUtil build problem
in thread Module::Build::XSUtil build problem

Yes - Something is up with CPAN::Meta on this box. On my solaris box I installed this module (baseline is perl 5.12 but I needed to download CPAN::Meta to install this module). The Solaris CPAN::Meta which works is at version 2.133380. On the Oracle Enterprise Linux box my perl is 5.10 and my CPAN::Meta is the latest version 2.140640.

There are some big diffs between the two version (perldoc annotation on the newer linux box being an obvious one). I will see if there is any difference in the details of the module.

  • Comment on Re^2: Module::Build::XSUtil build problem

Replies are listed 'Best First'.
Re^3: Module::Build::XSUtil build problem
by jimhallsun (Sexton) on Apr 09, 2014 at 17:29 UTC

    I hacked CPAN::Meta a little here:

    sub load_file { my ($class, $file, $options) = @_; print "My file is: $file\n"; #jhall $options->{lazy_validation} = 1 unless exists $options->{lazy_valida +tion}; croak "load_file() requires a valid, readable filename for $file" unless -r $file;

    On the good box it does:

    jhall@jimwin8:~/.cpan/build/Module-Build-XSUtil-0.06-d9Wlfd$ perlgcc2 Build.PL
    My file is: META.json
    Created MYMETA.yml and MYMETA.json
    Creating new 'Build' script for 'Module-Build-XSUtil' version '0.06'
    My file is: META.yml
    My file is: MYMETA.json
    My file is: META.json
    Merging cpanfile prereqs to MYMETA.yml
    Merging cpanfile prereqs to MYMETA.json
    

    On the bad box:

    oracle@localhost Module-Build-XSUtil-0.06-si9LjM$ perl Build.PL
    Deleting _build
    Creating custom builder _build/lib/MyBuilder.pm in _build/lib
    Checking whether your kit is complete...
    Looks good
    
    Checking prerequisites...
    Looks good
    
    Deleting Build
    Removed previous script 'Build'
    
    Creating new 'Build' script for 'Module-Build-XSUtil' version '0.06'
    My file is: MYMETA.json
    load_file() requires a valid, readable filename for MYMETA.json at Build.PL line 56
    

    I guess I need to sort out where is MYMETA.* created.... it must be buried in the new/create method... just difficult to sort out.

      I think the problem is in Parse::CPAN::Meta, seems to be a lot of changes here:

      --- Meta.pm 2014-03-04 15:22:05.000000000 -0500 +++ /u01/oracle/Meta.pm 2014-04-10 11:24:46.069085636 -0400 @@ -2,7 +2,7 @@ use 5.008001; use strict; package Parse::CPAN::Meta; # ABSTRACT: Parse META.yml and META.json CPAN metadata files -our $VERSION = '1.4414'; # VERSION +our $VERSION = '1.4413'; # VERSION use Exporter; use Carp 'croak'; @@ -13,30 +13,15 @@ our @EXPORT_OK = qw/Load LoadFile/; sub load_file { my ($class, $filename) = @_; - my $meta = _slurp($filename); - if ($filename =~ /\.ya?ml$/) { - return $class->load_yaml_string($meta); - } - elsif ($filename =~ /\.json$/) { - return $class->load_json_string($meta); - } - else { - $class->load_string($meta); # try to detect yaml/json + return $class->load_yaml_string(_slurp($filename)); } -} -sub load_string { - my ($class, $string) = @_; - if ( $string =~ /^---/ ) { # looks like YAML - return $class->load_yaml_string($string); - } - elsif ( $string =~ /^\s*\{/ ) { # looks like JSON - return $class->load_json_string($string); - } - else { # maybe doc-marker-free YAML - return $class->load_yaml_string($string); + if ($filename =~ /\.json$/) { + return $class->load_json_string(_slurp($filename)); } + + croak("file type cannot be determined by filename"); } sub load_yaml_string { @@ -136,7 +121,7 @@ Parse::CPAN::Meta - Parse META.yml and M =head1 VERSION -version 1.4414 +version 1.4413 =head1 SYNOPSIS @@ -216,13 +201,6 @@ This method deserializes the given strin If the source was UTF-8 encoded, the string must be decoded before ca +lling C<load_json_string>. -=head2 load_string - - my $metadata_structure = Parse::CPAN::Meta->load_string($some_strin +g); - -If you don't know whether a string contains YAML or JSON data, this m +ethod -will use some heuristics and guess. If it can't tell, it assumes YAM +L. - =head2 yaml_backend my $backend = Parse::CPAN::Meta->yaml_backend;

      Will see if I can trouble shoot further. Any suggestions appreciated.

        Ok - I sorted it out. It was two things:

        1. Module::Build::XSUtil will not build correctly with the Module::Build bundled with perl 5.10. the 5.10 module is at $VERSION = '0.35'; the latest which worked is at v0.4205
        2. When I installed the latest Module::Build this particular module installed in a new directory off my CPAN basedir: /u01/oracle/perl/lib/perl5. I updated my PERL5LIB and then I could find a new version of the module. Otherwise I got the error message:
          cpan20> test Module::Build::XSUtil
          Running test for module 'Module::Build::XSUtil'
          Running Build for H/HI/HIDEAKIO/Module-Build-XSUtil-0.06.tar.gz
            Has already been unwrapped into directory /u01/oracle/.cpan/build/Module-Build-XSUtil-0.06-36QCGd
            '/usr/bin/perl Build.PL --install_base /u01/oracle/perl' returned status 65280, won't make
          Running Build test
            Make had some problems, won't test
          

        Module::Build required newer versions of Module::Metadata and Perl::OSType.

        At some point I did install a newer build of Module::Build on the Solaris 11 with perl 5.12 and it had $VERSION = '0.4205'; of Module::Build. Would it be reasonable to ask the maintainer of Module::Build::XSUtil to put in his code a 'require' statement for a newer version of Module::Build? I think that would sort things out.