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

EDIT: I was able to resolve the issue below with finding Import/Into, but Moo is still failing to install.

My new method for installing comes from the links that were provided by an anonymous monk below.

setenv PERL5LIB /perl_test_lib/lib/perl5 setenv INSTALL_BASE /perl_test_lib setenv PERL_MM_OPT INSTALL_BASE=/perl_test_lib setenv PERL_MB_OPT --install_base /perl_test_lib

I suspect the PERL_MB_OPT is not needed, but the PERL_MM_OPT is. This got me to the point that Moo was failing due to some unspecific test failures(no testplan found and 0/1 tests were run). So I figured that was the end of this method.

I then decided to give cpanm a try. I downloaded the script and installed lib::local using it.

cpanm --local-lib=/perl_test_lib/ local::lib && perl -I /perl_test_lib +/lib/perl5/ -Mlocal::lib
Then I tried to install Getopt::ArgParse and failed on Moo
bin/cpanm --local-lib=/perl_test_lib/ Getopt::ArgParse
But I hit the same failure I hit with my standalone method.
Here is a link to the full log from cpanm:
[http://pastebin.com/E75jDAYx

Here is the part that I'm not sure what to do about:
Manifying 5 pod documents PERL_DL_NONLAZY=1 "/package_path/pkgs/perl/5.14.1/bin/perl" "-MExtUtil +s::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switche +s; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/accessor-coerce.t ................ No subtests run ... t/undef-bug.t ...................... Failed 1/1 subtests ... Test Summary Report ------------------- t/accessor-coerce.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output ... t/undef-bug.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 1 tests but ran 0 ... Files=68, Tests=293, 2 wallclock secs ( 0.08 usr 0.04 sys + 1.12 cu +sr 0.25 csys = 1.49 CPU) Result: FAIL Failed 30/68 test programs. 0/293 subtests failed. make: *** [test_dynamic] Error 25
29/30 failures are the first issue "no subtests run" then "No plan found n TAP" and the other failure if the undef-bug "1 test failed" "Bad plan".

Any ideas?

Original Post - only interesting for history

I'm seeing the following error when trying to `make test` Moo 1.006000
... # Failed test 'subs imported on 'use Moo::Role;' after 'no Moo::Role +;'' # at t/use-after-no.t line 22. # Can't locate Import/Into.pm in @INC (@INC contains: /path/to/lib/loc +al/lib/perl5/Moo-1.007000/blib/lib /path/to/lib/local/lib/perl5/Moo-1 +.007000/blib/arch /path/to/perl/5.14.1/lib64/site_perl/x86_64-linux / +path/to/perl/5.14.1/lib64/site_perl /path/to/perl/5.14.1/lib64/5.14.1 +/x86_64-linux /path/to/perl/5.14.1/lib64/5.14.1 /path/to/perl/5.14.1/ +lib64/module/default/x86_64-linux /path/to/perl/5.14.1/lib64/module/d +efault .) at /path/to/lib/local/lib/perl5/Moo-1.007000/blib/lib/Moo/R +ole.pm line 7. # BEGIN failed--compilation aborted at /path/to/lib/local/lib/perl5/Mo +o-1.007000/blib/lib/Moo/Role.pm line 7. # Compilation failed in require at (eval 9) line 3. # BEGIN failed--compilation aborted at (eval 9) line 3. # Looks like you failed 2 tests of 2. ...

I'm familiar with this type of error when writing scripts, but not when installing other modules. I'm working on a new tool suite and I am trying to build a somewhat self contained module package.

Some background on what I am trying to do.
I work in a large corporate Linux environment. The admins of this environment manage the default modules installed by default and even if I could convince them to add a laundry list of modules to the environment it would take an eternity.

To get around this I am using local::lib to install modules inside of my package library. When I'm done it should look something like this:

<package_path>/lib/perl5/Moo GetOpt/ArgParse Import/Into bin/myscript
I've been able to successfully install a few packages using this method:
#Get the proxy stuff out of the way setenv http_proxy <proxy> #Use wget and cpan to install Lib::Local wget http://search.cpan.org/CPAN/authors/id/H/HA/HAARG/local-lib-2.000 +015.tar.gz #Untar the library tar -xvpf local-lib-2.000015.tar.gz #cd into the untarred directory cd local-lib-2.000015 #Tell the makefile where you plan to install the library # Intended path: /path/to/install/lib/perl5/Local # Use: --bootstrap=/path/to/install perl Makefile.PL --bootstrap=/path/to/install #Run make test to ensure everything is setup correctly make test #Run make install the complete the install make install #You should now be ready to install any additional modules. #use wget to get the package from cpan(same as before) #untar the package and cd into the directory(same as before) #Execute the MakeFile(This will be different) perl -I/path/to/lib/local/lib/perl5 -Mlocal::lib=/path/to/install/new/ +module/ Makefile.PL #Then run make test and make install as before

Specifically, I've already installed Log4Perl:Appenders and have been able to successfully use it with my script.

I am currently working on installing GetOpt::ArgParse which requires Moo-1.006000. Moo has 4 dependencies, which I've been able to install as well. All apparently successfully. I am able to create the make file for Moo, but `make test` fails horribly.

What I've tried so far:
1) I've tried a few different Moo versions 1.006/1.006001/1.007
2) I've updated to ExtUtils-MakeMaker-7.00, and reinstalled local::lib since I had seen a warning about the version of that I was using.
3) I've tried using Import::Into in my script, which is able to find it.

So it seems like something Moo is doing is causing it to lose my include path from the perl command line when calling the MakeFile.PL. Has anyone dealt with similar issues before?

I am aware that I could try to use cpan for this process along with local::lib, but I've hit similar issues with it, so for now I'm doing it's job manually.

Replies are listed 'Best First'.
Re: Problems Installing Moo with local::lib
by syphilis (Archbishop) on Sep 20, 2015 at 06:14 UTC
    Can't locate Import/Into.pm ...

    Has Import::Into been installed ?
    If so, where is it ? ... and what does perl -V output for you ?

    Cheers,
    Rob
      If this is the command I'm using to cal the Makefile
      perl -I/path/to/lib/local/lib/perl5 -Mlocal::lib=/path/to/install/new/ +module/ Makefile.PL
      Then Import/Into.pm is installed at:
      /path/to/lib/local/lib/perl5/Import/Into.pm
      perl -v This is perl 5, version 14, subversion 1 (v5.14.1) built for x86_64-li +nux Copyright 1987-2011, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.
Re: Problems Installing Moo with local::lib
by Anonymous Monk on Sep 20, 2015 at 08:23 UTC

    Here is an idea, forget all about local::lib, and use INSTALL_BASE and PERL5LIB yourself?

    See Re: Unable to install perl module Sendmail

      -I/path/to/lib/local/lib/perl5 is a great way to add to @INC for one program ... but usually not for the programs that one program launches

      That makes sense. I might take a run at that approach when I take a second pass at installing ArgParse. I'll let you know how it goes. EDIT: Tried the method and came to the same issue. Updating the original post with details.