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

I'm trying to install Inline::C via CPAN and it's failing. Here is my log file up until the error:

Going to read '/home/user1/.cpan/Metadata' Database was generated on Tue, 12 Mar 2013 15:53:02 GMT Running install for module 'Inline::C' Running make for S/SI/SISYPHUS/Inline-0.52.tar.gz Checksum for /home/user1/.cpan/sources/authors/id/S/SI/SISYPHUS/Inline +-0.52.tar.gz ok CPAN.pm: Going to build S/SI/SISYPHUS/Inline-0.52.tar.gz Checking if your kit is complete... Looks good Inline::C is packaged with Inline.pm because it is the most commonly u +sed Inline Language Support Module (ILSM). See also: Inline::ASM, ::Awk, ::BC, ::Basic, ::Befunge, ::CPP (C++), : +:CPR, ::Foo, ::Guile, ::Java, ::Octave, ::PERL, ::Python, ::Ruby, +::TT, ::Tcl and ::WebChat. Config.pm indicates that your version of Perl was built with this C co +mpiler: gcc-4 I have located this compiler on your system. Do you want to install Inline::C? [y] Writing Makefile for Inline::C Writing MYMETA.yml Writing Makefile for Inline Writing MYMETA.yml cp Inline.pod blib/lib/Inline.pod cp lib/Inline/MakeMaker/Changes blib/lib/Inline/MakeMaker/Changes cp lib/Inline/denter.pm blib/lib/Inline/denter.pm AutoSplitting blib/lib/Inline/denter.pm (blib/lib/auto/Inline/denter) cp Inline.pm blib/lib/Inline.pm AutoSplitting blib/lib/Inline.pm (blib/lib/auto/Inline) cp lib/Inline/Foo.pm blib/lib/Inline/Foo.pm cp Inline-API.pod blib/lib/Inline-API.pod cp lib/Inline/MakeMaker.pm blib/lib/Inline/MakeMaker.pm cp Inline-FAQ.pod blib/lib/Inline-FAQ.pod cp Inline-Support.pod blib/lib/Inline-Support.pod make[1]: Entering directory `/home/user1/.cpan/build/Inline-0.52-9pbT8 +q/C' cp lib/Inline/C/ParseRegExp.pm ../blib/lib/Inline/C/ParseRegExp.pm cp C-Cookbook.pod ../blib/lib/Inline/C-Cookbook.pod cp C.pm ../blib/lib/Inline/C.pm cp C.pod ../blib/lib/Inline/C.pod cp lib/Inline/C/ParseRecDescent.pm ../blib/lib/Inline/C/ParseRecDescen +t.pm Manifying ../blib/man3/Inline.C.ParseRegExp.3pm Manifying ../blib/man3/Inline.C-Cookbook.3pm Manifying ../blib/man3/Inline.C.ParseRecDescent.3pm Manifying ../blib/man3/Inline.C.3pm make[1]: Leaving directory `/home/user1/.cpan/build/Inline-0.52-9pbT8q +/C' Manifying blib/man3/Inline.3pm Manifying blib/man3/Inline-API.3pm Manifying blib/man3/Inline-FAQ.3pm Manifying blib/man3/Inline-Support.3pm SISYPHUS/Inline-0.52.tar.gz /usr/bin/make -- OK 'YAML' not installed, will not store persistent state Running make test make[1]: Entering directory `/home/user1/.cpan/build/Inline-0.52-9pbT8 +q/C' make[1]: Leaving directory `/home/user1/.cpan/build/Inline-0.52-9pbT8q +/C' PERL_DL_NONLAZY=1 /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "te +st_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00init.t ............. ok t/01usages.t ........... ok t/02config.t ........... ok t/03errors.t ........... ok t/04create.t ........... ok t/05files.t ............ ok t/06rewrite_config.t ... ok t/07rewrite2_config.t .. ok All tests successful. Files=8, Tests=19, 15 wallclock secs ( 0.08 usr 0.05 sys + 1.24 cusr + 1.66 csys = 3.03 CPU) Result: PASS make[1]: Entering directory `/home/user1/.cpan/build/Inline-0.52-9pbT8 +q/C' PERL_DL_NONLAZY=1 /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "te +st_harness(0, '../blib/lib', '../blib/arch')" t/*.t t/00init.t .............. ok t/01syntax.t ............ Dubious, test returned 2 (wstat 512, 0x200) Failed 5/5 subtests t/02config.t ............ Dubious, test returned 2 (wstat 512, 0x200) Failed 1/3 subtests t/03typemap.t ........... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/04perlapi.t ........... Dubious, test returned 2 (wstat 512, 0x200) Failed 1/1 subtests t/05xsmode.t ............ Dubious, test returned 2 (wstat 512, 0x200) Failed 1/1 subtests t/06parseregexp.t ....... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/07typemap_multi.t ..... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/08taint.t ............. Dubious, test returned 2 (wstat 512, 0x200) Failed 9/10 subtests t/09parser.t ............ Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/10callback.t .......... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/11default_readonly.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 1/1 subtests t/12taint_old.t ......... ok t/14void_arg.t .......... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/15ccflags.t ........... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/16ccflagsex.t ......... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/17prehead.t ........... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/18quote_space.t ....... ok t/19INC.t ............... Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/20eval.t .............. Failed 1/5 subtests Test Summary Report ------------------- t/01syntax.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 5 tests but ran 0. t/02config.t (Wstat: 512 Tests: 2 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 3 tests but ran 2. t/03typemap.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/04perlapi.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 1 tests but ran 0. t/05xsmode.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 1 tests but ran 0. t/06parseregexp.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/07typemap_multi.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/08taint.t (Wstat: 512 Tests: 1 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 10 tests but ran 1. t/09parser.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/10callback.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/11default_readonly.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 1 tests but ran 0. t/14void_arg.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/15ccflags.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/16ccflagsex.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/17prehead.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/19INC.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: No plan found in TAP output t/20eval.t (Wstat: 0 Tests: 5 Failed: 1) Failed test: 1 Files=20, Tests=20, 92 wallclock secs ( 0.03 usr 0.08 sys + 29.27 cus +r 51.56 csys = 80.94 CPU) Result: FAIL Makefile:582: recipe for target `test_dynamic' failed make[1]: Leaving directory `/home/user1/.cpan/build/Inline-0.52-9pbT8q +/C' Makefile:814: recipe for target `subdirs-test' failed SISYPHUS/Inline-0.52.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports SISYPHUS/Inline-0.52.tar.gz Running make install make test had returned bad status, won't install without force

Can anyone tell what the problem is from the above? The first problem seems to be with this line:

t/01syntax.t ............ Dubious, test returned 2 (wstat 512, 0x200)

Replies are listed 'Best First'.
Re: install fails for Inline::C (hide errors)
by tye (Sage) on Mar 13, 2013 at 05:41 UTC

    It is quite sad that the test harness actively hides the actual error message and replaces it with a bunch of details that are usually rather useless (and, IME, often actually incorrect).

    If you learn how to do the rather simple steps to install a module without using all of the automation, then it becomes trivial to run t/01syntax.t directly so you can see the error message.

    It looks like CPAN.pm is running App::Prove for you so you might be able to read enough documentation in order to figure out how to tell Prove to just show you all of the test results instead of summarizing them (badly) or some other way to get at the error message.

    Maybe ExtUtils::Command::MM even documents its test_harness method.

    Without the real error message, everybody is reduced to rather wild guessing just based on the fact that all of the tests are failing. So something is likely going wrong with just trying to load the module. Somebody who has seen a similar-looking failure can guess that something that they did might also work for you.

    But I'd certainly go find the real error. Doing that is how one learns to diagnose problems which can be a very valuable skill to build, IME.

    - tye        

      If you learn how to do the rather simple steps to install a module without using all of the automation, then it becomes trivial to run t/01syntax.t directly so you can see the error message.

      When you say "without all of the automation", do you mean install modules manually without using CPAN at all? If I do that, will I ever be able to update manually-installed modules with CPAN in the future, or will I be forced to always manually update them?

        CPAN is a network of copies of a computer archive. I usually use CPAN when installing Perl modules. I rarely use CPAN.pm nor its bin/cpan wrapper. "Automation", of course, refers to modules like CPAN.pm (bad name), CPANPLUS (worse name), App::cpanminus, and probably others and their command-line components.

        I'm sure none of these automated wrappers around CPAN are dependent on their own, separate tracking of what they have installed. You can install one module "by hand" (usually via 'make') and another module via cpanminus and then CPANPLUS will see both of them there just fine and be able to tell what version they are and be able to upgrade them or determine that they don't need to be installed or upgraded for some other module that you are installing that depends on them.

        It, of course, gets rather tedious to install a module "by hand" if that module requires the installation of a huge number of other modules. But my experience says that it is usually wise to avoid those types of modules anyway. So it is only very rarely that I have much motivation to try automation.

        But I'm not trying to tell anybody to avoid automation as much as I do. I just encourage you to install some modules by hand.

        - tye        

Re: install fails for Inline::C
by syphilis (Archbishop) on Mar 13, 2013 at 09:19 UTC
    Can anyone tell what the problem is from the above?

    No (as already noted).
    If you could:
    cd /home/user1/.cpan/build/Inline-0.52-9pbT8q/C
    then run:
    perl -Mblib t/01syntax.t
    then we'll have a better chance.

    BTW, is this Cygwin ?

    Cheers,
    Rob

      Here is the output of the command you recommended:

      /home/user1/.cpan/build/Inline-0.52-9pbT8q/C[143]> perl -Mblib t/01syn +tax.t 1..5 # Running under perl version 5.014002 for cygwin # Current time local: Wed Mar 13 22:30:11 2013 # Current time GMT: Thu Mar 14 03:30:11 2013 # Using Test.pm version 1.25_02 Uncaught exception from user code: Files found in blib/arch: installing files in blib/lib into ar +chitecture dependent library tree Installing /home/user1/.cpan/build/Inline-0.52-9pbT8q/C/_Inline_test/l +ib/auto/_01syntax_t_6b3a/_01syntax_t_6b3a.dll chmod 755 /home/user1/perl5/lib/perl5/cygwin-thread-multi-64int/auto/_ +01syntax_t_6b3a/_01syntax_t_6b3a.dll chmod: cannot access `/home/user1/perl5/lib/perl5/cygwin-thread-multi- +64int/auto/_01syntax_t_6b3a/_01syntax_t_6b3a.dll': No such file or di +rectory Makefile:704: recipe for target `pure_install' failed make: *** [pure_install] Error 1 A problem was encountered while attempting to compile and install your + Inline C code. The command that failed was: make pure_install > out.make_install 2>&1 The build directory was: /home/user1/.cpan/build/Inline-0.52-9pbT8q/C/_Inline_test/build/_01syn +tax_t_6b3a To debug the problem, cd to the build directory, and inspect the outpu +t files. at t/01syntax.t line 34. ...propagated at ../blib/lib/Inline/C.pm line 772. BEGIN failed--compilation aborted at t/01syntax.t line 43. at t/01syntax.t line 43. One or more DATA sections were not processed by Inline.

      I am running using local::lib if it makes any difference. Also you are correct - I am running Cygwin.

        I am running using local::lib if it makes any difference

        I think that makes a lot of difference.
        This looks very much like this resolved bug.

        What is your current version of ExtUtils::MakeMaker ? (I'm guessing it's 6.57, but I'd like to know for sure, please.)
        If it's less than 6.62, could you update your ExtUtils::MakeMaker to version 6.62 and see if Inline then builds and installs correctly using the same approach that you first tried.

        If that does fix the problem, I'll try to modify the Inline::C Makefile.PL to check for use of "local::lib" (in addition to the check for INSTALL_BASE that it already does).

        Nothing can break perl quite like Cygwin can.

        Cheers,
        Rob
Re: install fails for Inline::C
by nagalenoj (Friar) on Mar 13, 2013 at 04:39 UTC
    I would suggest to go ahead with force option.
    cpan> force install <MODULE>
Re: install fails for Inline::C
by Khen1950fx (Canon) on Mar 13, 2013 at 23:47 UTC
    I don't think that the problem is with Inline::C. I ran it through automated testing and it passed all tests; however, I noticed that when you try to install Test::Harness, it will fail in the cpan shell but install with a cpan shell script. Here's the cpan shell script that I ran tests on. Give it a test drive:
    #!/usr/bin/perl BEGIN { $| = 1; $^W = 1; $ENV{'PERL_MM_USE_DEFAULT'} = 1; $ENV{'MB_TEST_EXPERIMENTAL'} = 1; } use strict; use warnings; use CPAN; CPAN::Shell->install(qw( Exporter Carp XSLoader AutoLoader constant Data::Dumper Scalar::Util Test File::Spec Time::HiRes Pod::Simple Encode Pod::Man ExtUtils::MakeMaker MIME::Base64 Test::Harness Test::More Digest::base Digest::MD5 IO::Handle Text::Balanced SelfLoader File::Temp CPAN CPAN::Meta::YAML version lib ExtUtils::ParseXS Pod::Usage Getopt::Long Text::Abbrev JSON::PP Parse::CPAN::Meta Perl::OSType Locale::Maketext::Simple Module::Load::Conditional Module::Load Params::Check IPC::Cmd File::Path IO::Select Module::Metadata ExtUtils::CBuilder ExtUtils::Manifest CPAN::Meta::Requirements CPAN::Meta ExtUtils::Install PAR::Dist Module::Build Tree::DAG_Node Sub::Uplevel Test::Warn Parse::RecDescent Filter::Util::Call YAML YAML::Syck Inline::Files Inline::C));

      Khen1950fx: thanks, that seemed to work. What was the problem with the way I was trying to install it? What is your approach doing differently? Also normally when I try to install module I use:

      perl -MCPAN -Mlocal::lib -e 'CPAN::install(<module_name)'

      yet when running your script I apparently didn't need to specify -Mlocal::lib for perl/CPAN to know to install all those modules to my local lib rather than the default location. How did it know about my local lib?

      I would say I had a similar problem, but I read the logs and it turns out I had the exact same problems, without local::lib, it made no difference with or without it. The Inline::C failure was hidden from me just as the previous user and I had to get the test results manually, and of course they were different from the supposed 'summary'. Is there some sort of setting to force the test harness to output ALL the information about the running tests?

        It's unlikely that you would have the same exact failures as what someone else was experiencing six months ago. Inline and Inline::C have undergone a lot of revisions since then, including splitting them into separate distributions.

        Do this: Clone https://github.com/ingydotnet/inline-pm.git and https://github.com/ingydotnet/inline-c-pm.git, each into their own folders, and run make test. This will spit out a more verbose log of test passes/fails. Try this for each of Inline and Inline::C. That should give you a better idea of what is wrong. Feel free to drop by irc.perl.org#inline to discuss issues, or open a GitHub issue.


        Dave