jimhallsun has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

Trying to build the module in $SUBJECT, but hitting an error message that I suspect is simple environment setup problem, but ultimately not sure.

Here is the error message

Creating new 'Build' script for 'Module-Build-XSUtil' version '0.06' load_file() requires a valid, readable filename at Build.PL line 56

I look at Build.PL and line 56 has:

my $mbmeta = CPAN::Meta->load_file('MYMETA.json');

MYMETA.json is not in the module file manifest so it leads me to think this is an issue, but it does not look like it has ever been in the manifest looking at a couple of old versions on github.

I am running perl 5.10 on a linux box. Since there may be another reason as to why the module build is failing, the full build is below.

Thanks for any help

JIM

Running test for module 'Module::Build::XSUtil'
'YAML' not installed, falling back to Data::Dumper and Storable to read prefs '/u01/oracle/.cpan/prefs'
Running make for H/HI/HIDEAKIO/Module-Build-XSUtil-0.06.tar.gz
Checksum for /u01/oracle/.cpan/sources/authors/id/H/HI/HIDEAKIO/Module-Build-XSUtil-0.06.tar.gz ok
Module-Build-XSUtil-0.06/Build.PL
Module-Build-XSUtil-0.06/Changes
Module-Build-XSUtil-0.06/LICENSE
Module-Build-XSUtil-0.06/META.json
Module-Build-XSUtil-0.06/README.md
Module-Build-XSUtil-0.06/cpanfile
Module-Build-XSUtil-0.06/lib/Module/Build/XSUtil.pm
Module-Build-XSUtil-0.06/t/00_compile.t
Module-Build-XSUtil-0.06/META.yml
Module-Build-XSUtil-0.06/MANIFEST

  CPAN.pm: Going to build H/HI/HIDEAKIO/Module-Build-XSUtil-0.06.tar.gz

Creating custom builder _build/lib/MyBuilder.pm in _build/lib
Checking whether your kit is complete...
Looks good

Checking prerequisites...
Looks good

Creating new 'Build' script for 'Module-Build-XSUtil' version '0.06'
load_file() requires a valid, readable filename at Build.PL line 56
Warning: No success on command/usr/bin/perl Build.PL --installdirs ~/perl --install_base ~/perl
Warning (usually harmless): 'YAML' not installed, will not store persistent state
  HIDEAKIO/Module-Build-XSUtil-0.06.tar.gz
  /usr/bin/perl Build.PL --installdirs ~/perl --install_base ~/perl -- NOT OK
Running Build test
  Make had some problems, won't test
Could not read '/u01/oracle/.cpan/build/Module-Build-XSUtil-0.06-0TT05k/META.yml'. Falling back to other methods to determine prerequisites
Failed during this command:
 HIDEAKIO/Module-Build-XSUtil-0.06.tar.gz     : writemakefile NO '/usr/bin/perl Build.PL --installdirs ~/perl --install_base ~/perl' returned status 65280

Replies are listed 'Best First'.
Re: Module::Build::XSUtil build problem
by mtmcc (Hermit) on Apr 07, 2014 at 15:01 UTC
    I'm not familiar with this particular module, but mymeta.json is generally platform specific, and should be made by the Build.PL script itself, for your system.

    Do you have enough permission for Build.PL to write new files? Do you have all the Module-Build-XSUtil dependencies installed? Just some suggestions.

      You know - that is a good point. I am trying to do the install as a regular user and have perms for .cpan tree and the install dir is off the home dir with write access.

      I have to figure out where this module is writing or maybe the why the MYMETA file is not being generated. My CPAN config may have something wrong. It is just that I have a bunch of modules that have gone in fine.

Re: Module::Build::XSUtil build problem
by Anonymous Monk on Apr 07, 2014 at 20:16 UTC

    Which version of Module::Build and CPAN::Meta do you have? CPAN?

    I suggest upgrading all three

    I have no problem with cpanm and

    CPAN::Meta - 2.132140 Module::Build - 0.4007

      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.

        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.